小编Jea*_*rgo的帖子

返回表达式中的 VB6 函数问题“预期语句结束”

我是 vb6 的新手,当尝试返回变量时,我的函数中出现编译器错误。

\n
\n

“语句结束预期错误vb6”

\n
\n

我的功能如下:

\n
Public Function StringFormat(ByVal MyStr As String) As String\n   \n   Dim i As Integer\n   Dim sBadChar As String\n   Dim NewString As String\n   \n   ' List all illegal/unwanted characters\n   sBadChar = "/<>?\\{}[]()=,!#*:'*\xc2\xac-"\n\n   ' Loop through all the characters of the string\n   For i = 1 To Len(MyStr)\n       If InStr(sBadChar, Mid(MyStr, i, 1)) Then\n           Mid(MyStr, i, 1) = ""\n       End If\n   Next i\n   \n   Return MyStr\n   \nEnd Function\n
Run Code Online (Sandbox Code Playgroud)\n

我收到错误return,关于为什么会发生这种情况有什么想法吗?\n提前谢谢您

\n

vb6

0
推荐指数
1
解决办法
215
查看次数

标签 统计

vb6 ×1