jScripts智能手机批处理/脚本解释软件源码
function can be called as msgbox(abc(a,b),"OK") 1+2+3*5 msgbox($_) //display 18 if (a==b) 2 else 3 //work fine def fact(n) if (n==1) 1 else n*fact(n-1) end msgbox(fact(5)) //work fine display 120 ExprParser move to Interpreter. Single line if statement. ++/-- like C language return statement is not needed. of course you can use it. statement's result save to $_ so. Def fact(n) If (n==1) 1 # return 1 Else n*fact(n-1) # return n*fact(n-1) End End #this subroutie is work fine. &a=10 # Global eqaul a=10 n=1 Def abc(&n) &n++ # &n is global variable,now n=2 n=10 # this n is local variable, n=10 and global's n=2 &a=20 # this is not equal a=20 a=30 End switch/choice break statement add. eg. switch(a) case 1 msgbox(1) break # exit switch case 2 # if a==2 execute case 2 and case 3, because case 2 haven't break statement. msgbox(2) case 3 msgbox(3) break # if a==2 exit switch default msgbox("another") end repeat(8) statement has the count save in $_ msgbox($_) # show the count. a=10 msgbox($_) # show 10 endrepeat
- 1
- 2
- 粉丝: 0
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助