Byte Input in SuperBasic

Authors

Publication

Pub Details

Date

Pages

See all articles from QL Hacker's Journal 13

In the last QHJ, I mentioned that I could not get single byte input to work in SuperBasic for my QL to Z88 program. Peter Sulzer kindly wrote back and proved that I was wrong. Below is a short routine Peter sent that shows how standard SuperBasic can do byte input. – ED

100 OPEN_IN #4,'source':OPEN_NEW #5,'destination'
110 REPeat copy
120 IF NOT EOF(#4): a$=INKEY(#4,-1):ELSE EXIT copy
130 PRINT #5,a$;
140 END REPeat copy
150 CLOSE #4: CLOSE #5

With Turbo this is real fast, of course QLiberator is a bit slow for such “complicated” tasks. Of course you won’t reach the speed of the C function getc(fp) as C uses a buffer and must not access QDOS’ IO.FBYTE function for every byte – even an assembler prog using IO.FBYTE for every byte is most probably slower than a C prog using getc(fp)!

Products

 

Downloadable Media

 

Image Gallery

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top