Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String VisualBasic中的字符串空间不足_String_Vb6 - Fatal编程技术网

String VisualBasic中的字符串空间不足

String VisualBasic中的字符串空间不足,string,vb6,String,Vb6,在对字符串执行替换操作时,我收到一个错误:“字符串空间不足”对于VBA引用,但对于VB6通常类似: *需要为求值创建临时字符串的表达式可能会导致此错误。例如,以下代码在某些操作系统上导致字符串空间不足错误: MyString = "Hello" For Count = 1 To 100 MyString = MyString & MyString Next Count 将字符串指定给另一个名称的变量* 因此,如果您正在执行以下操作,则可能无法正确获取语法: myStr = Re

在对字符串执行替换操作时,我收到一个错误:“字符串空间不足”

对于VBA引用,但对于VB6通常类似:

*需要为求值创建临时字符串的表达式可能会导致此错误。例如,以下代码在某些操作系统上导致字符串空间不足错误:

MyString = "Hello"
For Count = 1 To 100
    MyString = MyString & MyString
Next Count
将字符串指定给另一个名称的变量*

因此,如果您正在执行以下操作,则可能无法正确获取语法:

myStr = Replace(myStr, "from", "to")
也许你可以这样做:

dim temp as String
temp = Replace(myStr, "from", "to")
myStr = temp

示例代码?我们不是读心术的人。也许:有帮助吗?