你好
你能更正我的密码吗?!?
1-我需要打开一个文件。
2-检查第一个数字是否与我的变量相同。
3-是的,请。。。。。
4不,检查下一行
我在这个论坛上搜索,发现了一些关于“freefile”的帖子
http://www.cadtutor.net/forum/showthread.php?t=27744
但是我没有找到解决问题的方法。
变量strtext仍然为空,子变量不停止,它是“循环”:嗯:
(我暂时删除“如果”部分)
- Sub FindScale(strVpScaleStd As String, strVpScaleCust As String)
- Dim strNomFichier As String
- Dim NomCalque As String
- Dim strTexte As String
- Dim iFichier As Integer
- Dim Position As Integer
- Dim strEchelle As String
- On Error Resume Next
- strNomFichier = "c:\vba\test.txt"
- iFichier = FreeFile
- Open strNomFichier For Input As #iFichier
- If Err Then
- MsgBox "Fichier " & strNomFichier & " introuvable."
- Exit Sub
- End If
- iFichier = FreeFile
- Do While Not EOF(iFichier)
- Line Input #iFichier, strTexte
- strTexte = Left(strTexte, 3)
- 'If Left(strTexte, 3) = strVpScaleStd Then
- ' Position = InStr(strTexte, "*")
- ' strEchelle = Mid$(strTexte, Position + 1)
- 'Else
- ' strTexte = ""
- 'End If
- Loop
- Close #iFichier
- If strEchelle = "" Then
- MsgBox "actual scale = " & strVpScaleCust
- End If
- End Sub
谢谢 |