L脚本语言不是仅支持中文,我还开发了一个英文版,当然,只不过是关键字全都替换为英文了,其实L脚本语言可以支持任意语种,利用全局动作注册的特性,我们自己可以对它进行改造
这是英文版的数学计算函数库及其调用的例子
#scplib
#mathmetic lib
define:function,get_circumference,radius
start:function,get_circumference
compute:expression,ret,2*3.14*radius
show:ret
end:function,get_circumference
define:function,get_area,radius
start:function,get_area
compute:expression,ret,3.14*(radius*radius)
show:ret
end:function,get_area
define:function,power,num1
start:function,power
compute:expression,ret,num1*num1
show:ret
end:function,power
define:function,square,num1
start:function,square
compute:expression,ret,num1*num1
show:ret
end:function,square
define:function,cube,num1
start:function,cube
compute:expression,ret,num1*num1*num1
show:ret
end:function,cube
define:function,remainder,num1,num2
start:function,remainder
compute:expression,ret,num1%num2
show:ret
end:function,remainder
define:function,averagevalue,n1,n2,n3
start:function,averagevalue
compute:expression,eee,(n1+n2+n3)/3
show:eee
end:function,averagevalue
#scp
import:library,D:\ScriptEngine\Scripts\en\testscript_numeric_lib.scp
define:int,rid2,10
define:int,rid,100
define:int,number1,8
define:int,number2,9
define:int,number3,100
show:"now calc circumference of circle"
call:function,get_circumference ,rid
show:"now calc area of circle"
call:function,get_area,rid2
call:function,power,number1
call:function,remainder,number2,number1
call:function,cube,number1
call:function,averagevalue,number1,number2,number3
call:function,averagevalue,100,200,300