Results 1 to 5 of 5

Thread: basic ---> visual basic DOH!!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    26

    Unhappy

    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.

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    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.

  3. #3
    Lively Member
    Join Date
    Mar 2000
    Posts
    81

    Question

    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.

  4. #4
    Guest
    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    26

    Talking

    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
  •  



Click Here to Expand Forum to Full Width