
I am currently working on a pet project to build an interpreted version of BASIC. It is coming along nicely, and I am adding features almost daily.
Currently the commands recognized by the interpreter are...
Command Line Switches
KwikBAS.exe sourcefile [-s]ilent [-t]imed [-n]o pause [-d]ebug trace
----------------------------------------------------------------------------
-s | Hides interpreter start/end messsages
-n | No pause when program is finished
-t | Displays execution time
-d | Displays number of line being executed
Supported Commands
Supported Commands v 0.2.10
#! -Shebang directive (Linux Only)
Arrays (x [, y])
Most mathematical operations
Hexadecimal notation (ie: &hAE10)
Const var = [numeric expression]
Dim [Shared] var[(idx1[,idx2])]AS datatype
Dim AS datatype var[(idx1[,idx2])]
var[(idx1[,idx2])] = value
Scope/End Scope
Cls
Colorfore,back
Printexpr
Cons [expr] <- Works like PRINT but always goes to console window
If expr Then / Else | EndIf
Mid / Left / Right
Len(string)
Spc(count)
Space(count)
String(count,char)
Instr(start,string,sub-string)
Chr(ascii_code)
Asc(char_string)
Do {Until|While} / Loop {Until|While} / Exit Do
For/Next | STEP | Exit For
While [expr]/Wend / Exit While
Mid / Left / Right
Len(string)
Spc(count)
Space(count)
String(count,char)
Instr(start,string,sub-string)
Csrlin()
Pos()
Locate row,col,cursorstate
Now()
Date()
Time()
DateSerial(yyyy,mm,dd)
TimeSerial(hh,mm,ss)
Year(date_serial)
Month(date_serial)
Day(date_serial)
Hour(time_serial)
Minute(time_serial)
Second(time_serial)
SetDate date_string
SetTime time_string
Input [prompt][;][,] var
Inkey
Timer
Sleep [ms]
End
Gosub
Return
Cons [expr] <- Works like PRINT but always goes to console window
ScreenRes width,height[,depth][,num_pages][,flags][,refresh]
ScreenSet [work_page][,visible_page]
Pset [dst,](x,y)[,color]
Line [dst,][STEP](x1,y1)-[STEP](x1,y2)[,color][,BF][,style]
Open filename For {INPUT|OUTPUT|APPEND|RANDOM|BINARY} As #file_num [,Len = record_length]
Close #file_num
Print #file_num, var_list [,…]
Write #file_num, var_list [,…]
Input #file_num, var_list [,…]
If you would like to test out the interpreter you can download it here...
Download KwikBASIC