BASIC x VB - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

BASIC x VB

celiocelio Posts: 2Member

I NEED CHANGE THE SAMPLE FOR VISUAL BASIC

10 '--------> READ STATUS
20 LPRINT CHRS(0)
30 BASE=&HF8
40 T=Timer
50 IF(Timer-T)<0.1 THEW GOTO 50
60 IF((IMP(BASE+5) AND 1) <> 1 THEW GOTO 150
70 STATUS=IMP(BASE)
80 PRINT "STATUS x"; Hex$(status); "h"
90 IF STATUS AND 2 THEN PRINT "BUFFER FULL"
100 IF STATUS AND 4 THEN PRINT "NOT LEAF"
110 IF STATUS AND 8 THEN PRINT "PRINTING"
120 IF STATUS AND 16 THEN PRINT "FAIL BORDER"
130 IF STATUS AND 32 THEN PRINT "FAIL ENGINE"
140 END
150 PRINT "Connection error"
160 RETURN

Comments

  • BASIC FriendBASIC Friend Posts: 354Member
    :
    : I NEED CHANGE THE SAMPLE FOR VISUAL BASIC
    :
    : 10 '--------> READ STATUS
    : 20 LPRINT CHRS(0)
    : 30 BASE=&HF8
    : 40 T=Timer
    : 50 IF(Timer-T)<0.1 THEW GOTO 50 [red]'THEN not THEW[/red]
    : 60 IF((IMP(BASE+5) AND 1) <> 1 THEW GOTO 150 [red]'GOSUB not GOTO[/red]
    : 70 STATUS=IMP(BASE)
    : 80 PRINT "STATUS x"; Hex$(status); "h"
    : 90 IF STATUS AND 2 THEN PRINT "BUFFER FULL"
    : 100 IF STATUS AND 4 THEN PRINT "NOT LEAF"
    : 110 IF STATUS AND 8 THEN PRINT "PRINTING"
    : 120 IF STATUS AND 16 THEN PRINT "FAIL BORDER"
    : 130 IF STATUS AND 32 THEN PRINT "FAIL ENGINE"
    : 140 END
    : 150 PRINT "Connection error"
    : 160 RETURN
    :

    You may want to debug this little snippet before you try to translate it into any other language. Did you run it in GW or BASICA?

    One error I notice right off is line 60. THEW GOTO 150. Besides the obvious syntax error you are also goto-ing where you should be gosub-ing.
Sign In or Register to comment.