This is a script engine for the modern BASIC powered by the Jujube core. It is compatible with VBScript and has the modern features added. In addition, the Classic-ASP layer is implemented(on the way) as a library, so you can port your website to the Linux.
> oscript sample.obs
> echo "wscript.echo 123" | ./oscript
[ Windows ] [ OSX ] [ Linux ] : ver.20191209
WScript.Echo "Hello World!"
obj = CreateObject("Scripting.Dictionary")
str = Trim(" A Script Engine ")
Class Animal Dim wing Function fly() return wing End Function End Class
Dim v = 0
n = If i<100 Then i Else 100 End If
@infinite WScript.Echo "oh my." GoTo @infinite
10 X = 1 20 WSCRIPT.ECHO X 30 X = X + 1 40 IF X<=10 THEN GOTO 20 END IF
Function greet(name="Steve") WScript.Echo "Hello " & name & "!" End Function
Function add(a, b) return a+b End Function
self.say = Function() WScript.Echo "My name is " & self.name End Function
On Error GoTo Catch a = 1 / 0 On Error Catch WScript.Echo "error occurred" On Error GoTo 0
obj = { "name" : "Steve", "age" : 24, }
obj = { "name" : "Steve" } str = obj()
obj = {} obj() = "{ ""name"" : ""Steve"" }"
a = ++i b = i++
n = 9223372036854775807
x = 3 '// copy or compare in situation x := 3 '// always copy x == 3 '// always compare
obj?.method()
x = obj ?? errobj
if obj === "" then obj:=empty end if
<ul> <% i = 10 %> <% do while i-- %> <li><%= i %>: <%= now %></li> <% loop %> </ul>
These words will be ignored, you don't need use such words.
You can extend library by so(dll).
See "GUI.cpp" to create your own library.