我瞎弄了一下。
基本上的编程格式就是
REPEAT
程序
UNTIL FALSE
你可以将你的MotionPerfect软件中链接模拟器,然后装入程序就可以装入Demo程序,来看看人家怎么写的。
至于变量定义,似乎随意,并不需要去定义后使用,即写即用。
其他请看随机的Help文件,如果你有新版的软件也可以拿出来大家学习一下。
付帖上一个Demo的样式:
'
' Demonstrate number entry via Emulated Keypad:
'
' Open keypad as #5
'
length=1
PRINT#5,CHR(12);CHR(14);
'
' Get number as length and write to global variable
' for use by program MOVEX
'
' Note how local variable "length" is set to the same
' value in BOTH programs
'
REPEAT
GOSUB getnum //标准格式,然后调用子程序。
VR(length)=num
UNTIL FALSE
getnum: pos=40
dpoint=0
num=0
negative=1
PRINT#5,CHR(20);
REPEAT
PRINT#5,CURSOR(pos);num*negative[8,2];
GET#5,k
IF k=72 AND dpoint=0 THEN dpoint=1
IF k=70 THEN negative=-negative
IF k=69 THEN GOTO getnum
IF k>=59 AND k<=61 THEN k=k-7
IF k>=66 AND k<=68 THEN k=k-17
IF k=71 THEN k=48
IF k>47 AND k<58 THEN
k=k-48
IF dpoint>0 THEN
dpoint=dpoint/10
IF dpoint>=0.01 THEN num=num+k*dpoint
ELSE
num=num*10+k
ENDIF
ENDIF
UNTIL k=73
num=num*negative
RETURN
10-08-12 17:22