在 Business Basic 中传递变量似乎不起作用
下面的代码调用我编写的一个程序,该程序自动创建一个输入字段,其两侧带有一定长度的括号。
C$
是我们在业务中的所有程序中使用的标准变量; 长度为10
; 年龄:
是标签; x 坐标为1
; y 坐标为 1
并且 IN$
是输入语句的变量
3020 CALL "SCOINPUT",C$,10,"AGE: ",1,1,IN$
以下程序生成输入行:
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
打印该行时,所有内容都位于正确的位置,但长度并不像应有的那样限制为 10 ...有人有什么建议吗?
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
andIN$
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
LEN
选项而不是SIZ
来限制输入Use the
LEN
option rather thanSIZ
for restricting input