--- title: "Byte Input in SuperBasic" type: "article" slug: "byte-input-in-superbasic" url: "http://localhost/article/byte-input-in-superbasic/" markdown_url: "http://localhost/article/byte-input-in-superbasic.md" published_at: "2025-11-27T14:11:05+00:00" modified_at: "2025-11-27T14:11:05+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "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…" category: - name: "QL Hacker's Journal" slug: "ql-hackers-journal" taxonomy: "category" url: "http://localhost/category/periodicals/ql-hackers-journal/" post_tag: - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" publication_r: id: 33686 title: "QL Hacker’s Journal" type: "periodical" url: "http://localhost/periodical/ql-hackers-journal/" authors: "Peter Sulzer" issue: "13" issues_articles: - id: 61549 title: "QL Hacker’s Journal 13" type: "issue" url: "http://localhost/issue/ql-hackers-journal-13/" pubdate: "April 1993" archive_link: true --- # Byte Input in SuperBasic 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)!