ifix中不能直接用GetSetting吗?
大家好,下面这段代码在vb编程环境里我试过是好的,可移到ifix脚本里一运行就提示“无效的过程调用或参数”,点击调试则“getS = GetSetting(AppName, secName, KeyN)”会标注黄色,这是什么原因?知道的帮忙解答下啊。先谢谢了。代码如下:
Const AppName = "PassSet"
Const secName = "PassWords"
Const KeyN = "PassWords"
Private Sub CommandButton1_Click()
Dim tmpS As String
Dim getS As String
Dim tmpSS As String
getS = GetSetting(AppName, secName, KeyN)
Err4:
tmpS = InputBox("请输入旧密码:", "密码")
If StrPtr(tmpS) = 0 Then
Exit Sub
Else
If getS = tmpS Then
Err3:
tmpS = InputBox("请输入新密码:", "密码")
If StrPtr(tmpS) = 0 Then
Exit Sub
Else
If tmpS = vbNullString Then GoTo Err3
If Not AnsyPass(tmpS) Then
MsgBox "密码设置错误!格式:只能是字母、数字或其组合 "
GoTo Err3:
Else
Err5: tmpSS = InputBox("请再次输入新密码:", "密码")
If StrPtr(tmpSS) = 0 Then
Exit Sub
Else
If tmpSS = vbNullString Then GoTo Err5
If Not AnsyPass(tmpSS) Then
MsgBox "密码设置错误!格式:只能是字母、数字或其组合 "
GoTo Err5:
Else
If tmpSS = tmpS Then
SaveSetting AppName, secName, KeyN, tmpS
MsgBox "密码修改成功! "
Else
Err6: tmpS = InputBox("两次密码输入不一致!请重新输入新密码:", "密码")
If StrPtr(tmpS) = 0 Then
Exit Sub
Else
If tmpS = vbNullString Then GoTo Err6
If Not AnsyPass(tmpS) Then
MsgBox "密码设置错误!格式:只能是字母、数字或其组合 "
GoTo Err6:
Else
GoTo Err5:
End If
End If
End If
End If
End If
End If
End If
Else
MsgBox "旧密码输入错误!请重新输入"
GoTo Err4
End If
End If
End Sub
Private Function AnsyPass(ByVal S As String) As Boolean
Dim i As Long
AnsyPass = True
For i = 1 To Len(S)
If Not ((Asc(Mid$(S, i, 1)) >= Asc(0) And Asc(Mid$(S, i, 1)) <= Asc(9)) Or (Asc(Mid$(S, i, 1)) >= Asc("A") And Asc(Mid$(S, i, 1)) <= Asc("Z")) Or (Asc(Mid$(S, i, 1)) >= Asc("a") And Asc(Mid$(S, i, 1)) <= Asc("z"))) Then
AnsyPass = False
Exit For
End If
Next
End Function --------------------编程问答-------------------- 问题解决了,不是代码的问题。
补充:VB , VBA