I have an app that uses an ini file to store folder paths, com port numbers, and file extensions.
I am able to read from the ini file fine when I do this:
Private Sub Form_Load()
Call getin
comport = ia 'comm port for serial communications
End Sub
Private Sub getin()
ia = "": 'process comments in audiorelay.ini
1 If EOF(1) Then GoTo 2 ' check for eof
Line Input #1, ia 'get line
' if is does not have a comment code then return it
If Left$(ia, 1) <> "'" Then GoTo 2
GoTo 1
2 '
End Sub
However....when I MsgBox (comport) in another subroutine, i get a blank box and nothing as its value. i can MsgBox (comport) after calling the value from the ini file and all is fine, but try to use the comport in another routine and it is empty.
Note, I have an ini file with only about 15 lines of text in it and the first several (4 or so) work fine by calling them elsewhere in the app but the later ones do not.
Any ideas?
fergmj
I am able to read from the ini file fine when I do this:
Private Sub Form_Load()
Call getin
comport = ia 'comm port for serial communications
End Sub
Private Sub getin()
ia = "": 'process comments in audiorelay.ini
1 If EOF(1) Then GoTo 2 ' check for eof
Line Input #1, ia 'get line
' if is does not have a comment code then return it
If Left$(ia, 1) <> "'" Then GoTo 2
GoTo 1
2 '
End Sub
However....when I MsgBox (comport) in another subroutine, i get a blank box and nothing as its value. i can MsgBox (comport) after calling the value from the ini file and all is fine, but try to use the comport in another routine and it is empty.
Note, I have an ini file with only about 15 lines of text in it and the first several (4 or so) work fine by calling them elsewhere in the app but the later ones do not.
Any ideas?
fergmj