Login
Back to forumSee the full topicGo to last reply

Posted By

JamesC
on 2018-02-28
10:54:02
 Re: Use of spaces in INPUT#/PRINT# statements

The initial space is written to disk. INPUT# fails to capture leading spaces from disk (just as INPUT fails to capture leading spaces from the keyboard).

Test program:
10 REM : PRINT# / INPUT# TEST
20 A$ = CHR$(32) + "ABCDE" : REM ENSURE SPACE PRECEEDS LETTERS
30 OPEN8,8,8,"PRINT/INPUT TEST,S,W"
40 PRINT#8,A$
50 PRINT#8," FGHIJ " : REM SPACE BEFORE AND AFTER LETTERS
60 PRINT#8,"KLMNO" : REM NO SPACES
70 CLOSE8
80 OPEN5,8,5,"PRINT/INPUT TEST,S,R"
90 INPUT#5,T1$
100 INPUT#5,T2$
110 INPUT#5,T3$
120 CLOSE 5
130 PRINTT1$,LEN(T1$)
140 PRINTT2$,LEN(T2$)
150 PRINTT3$,LEN(T3$)

Results:





Back to top


Copyright © Plus/4 World Team, 2001-2024