for FILL$ the maximum is long$=FILL('x',32764)
To make a longer string you can use:
long2$=long$&'x' : REMark ...&'xx' will fail with arithmetic overflow
The longest string I was able to create is 32766 characters long, and was created with an INPUT statement, with the help of the following program:
Code: Select all
100 REMark Test input string$ with a string length of 32767
990 :
1000 fnam$='RAM1_test_txt'
1010 tmp$='AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789--'
1020 REMark LEN(tmp$)=64:64*511+63=32767
1090 :
1100 exists=FTEST(fnam$):IF NOT(exists=0 OR exists=-9)
1110 OPEN_NEW#4,fnam$
1120 FOR i=1TO 511
1130 PRINT#4,tmp$;
1140 END FOR i
1150 PRINT#4,tmp$(1TO 62); : REMark If the PRINTed string is longer than 62 chars
1160 : REMark SBASIC may crash when INPUT (see line 2120)
1170 PRINT#4 :REMark print LF so that we can use INPUT veryLong$
1180 CLOSE#4
1190 ELSE
1200 PRINT"Using existing file ";fnam$
1210 END IF
1990 :
2000 rorre=FOP_IN(#4,fnam$):PRINT"FOP_IN()-Result=";rorre:IF rorre
2010 PRINT"Cannot open ";fnam$;", error:":REPORT#1,rorre
2020 GO TO 32756:REMark Exit program - STOP may cause problem on some QLs
2030 END IF
2090 :
2100 REMark Test INPUTting a string with maximum length:
2110 :
2120 INPUT#4,veryLong$
2130 CLOSE#4
2140 PRINT"veryLong$ has been read"\"LEN()=";LEN(veryLong$)
2150 PRINT"First 64 chars of veryLong$:"
2160 PRINT veryLong$(1TO 64)
2170 :
32755 :
32756 CLOSE#4
32757 REMark END OF PROGRAM -- do NOT use line numbers > 32757, may give problems
Peter