|
-
Jul 12th, 2000, 08:10 AM
#1
Thread Starter
Junior Member
I'm totally abusing the forum today... only 9:00 and already on my second question...
Anywayz, somebody at work wrote a program in basic a long time ago, now I have to convert it to visual basic. Well I'm stuck on this lil' bit of code here:
IF INSTR(InLine, "1.0000") = 14 THEN LPRINT " DX ";
IF INSTR(InLine, "1.0000") = 26 THEN LPRINT " DY ";
IF INSTR(InLine, "1.0000") = 38 THEN LPRINT " DZ";
I think it's searching for the string "1.000" at either the 14, 26, or 38 space. How do I do this in VB?
Once again, thanks in advance.
-
Jul 12th, 2000, 08:20 AM
#2
The If part of these statements would be the same in VB. You'll have to change the LPRINTs however, to direct them to whatever output option you want. (Print to form, Debug.Print, MsgBox, etc.)
"It's cold gin time again ..."
Check out my website here.
-
Jul 12th, 2000, 08:21 AM
#3
Lively Member
Are you asking what the equivalent INSTR function is or what LPRINT does or how to simulate LPRINT or something else?
Some cause happiness wherever they go; others, whenever they go.
-
Jul 12th, 2000, 08:23 AM
#4
It should bascially be the Same in VB. Make a TextBox called InLine, and put the following code into a CommandButton.
When you click the button, it will search the TextBox for 1.0000 and if it's found on any of the given lines, it will print DX, DY, or DZ.
Code:
Private Sub Command1_Click()
If InStr(InLine, "1.0000") = 14 Then Print " DX "
If InStr(InLine, "1.0000") = 26 Then Print " DY "
If InStr(InLine, "1.0000") = 38 Then Print " DZ"
End Sub
-
Jul 12th, 2000, 08:33 AM
#5
Thread Starter
Junior Member
I overlooked the Lprint and couldn't figure out why it was in all red... silly me...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|