Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 1677
Number of posts: 4766

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
BASIC x VB Posted by celio on 31 Jul 2002 at 5:31 AM

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

Report
Re: BASIC x VB Posted by BASIC Friend on 11 Aug 2002 at 10:41 PM
:
: 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 'THEN not THEW
: 60 IF((IMP(BASE+5) AND 1) <> 1 THEW GOTO 150 'GOSUB not GOTO
: 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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.