gonzal13
asked on
Visual basic does not use line numbers as Fortran
I am new at using visual basic. What I want to do is translate 25,000 lines of code that I did many years ago in Darthmoth Basic and update the program. Now Darthmouth basic uses line numbers where as MS Visual Basic does not. Is thare a way to refer to a line of code in a for else do loop, etc?
gonzal13(Joe)
gonzal13(Joe)
VB still understands line numbers and you can jump around to them using the GoTo statement.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
With numbers, you don't even need the colon afterwards. That is reserved for alpha labels.
ASKER
dasari
Thanks for your answer. You were the only one that provided the syntax
Gonzal13(Joe)
Thanks for your answer. You were the only one that provided the syntax
Gonzal13(Joe)
A : symbol in VB designates an end of a line and the begining of the next one. Technically you can write your code like this
Sub Test()
Dim x, y, z: x = 1: y = 2: z = 1: If y = 2 Then MsgBox x + x + y * y - z
End Sub
BTW, I think this question should have been a split at best.
Leon
Sub Test()
Dim x, y, z: x = 1: y = 2: z = 1: If y = 2 Then MsgBox x + x + y * y - z
End Sub
BTW, I think this question should have been a split at best.
Leon
ASKER
Okay:
I am sure that splitting the points would be Ok although the amound is very low and already has been awarded before your comment came in. Therefore, I shall leave everything as they are.
I think I shall get another book on Visual Basic. The one I have, is very basic and does cover my needs.
gonzal13 (Joe)
I am sure that splitting the points would be Ok although the amound is very low and already has been awarded before your comment came in. Therefore, I shall leave everything as they are.
I think I shall get another book on Visual Basic. The one I have, is very basic and does cover my needs.
gonzal13 (Joe)
Sub Test()
GoTo LABEL
Msgbox "Before"
LABEL:
Msgbox "After"
End Sub
But, you should really think about recoding the methodaloggy of the program and utilize object oriented structures.
Leon