Passing variables in Business Basic appears to not be working
The following code calls a program I made that automatically creates an input field with brackets on either side at a certain length.
C$
is a standard variable we use in all our programs in the business;
the length is 10
;
Age:
is the label;
the x coordinate is 1
;
the y coordinate is 1
and
IN$
is the variable for the input statement
3020 CALL "SCOINPUT",C$,10,"AGE: ",1,1,IN$
The following program makes the input line:
0100 REM 100 - SCOINPUT - CREATES AN INPUT LINE WITH BRACKETS开发者_运维技巧 AND TO A CERTAIN
0100: SIZE
0150 SETERR 15000
0155 ENTER C$,INSIZE,LABEL$,X,Y,IN$
0160 LET LABEL$=CVS(LABEL$,7)
0170 LET EBRAK=X+LEN(LABEL$)+SIZE+2
0300 IF INSIZE<>0 THEN GOTO 0400 ELSE GOTO 0500
0400 PRINT @(X,Y),LABEL$+" [",@(EBRAK,Y),"]",
0410 INPUT (0,SIZ=INSIZE)@(X+LEN(LABEL$)+2,Y),"",IN$
15000 SETERR 15010; EXIT
15010 END
When the line is printed, everything is in the correct place, however the length isn't limited to 10 like it should be... anyone have any suggestions?
Use the LEN
option rather than SIZ
for restricting input
0410 INPUT (0,LEN=INSIZE)@(X+LEN(LABEL$)+2,Y),"",IN$
精彩评论