Interpreted programming language. IDE includes documentation.
Programs can be also run from terminal with "java -jar BPLVM.jar program.bpl"
Functions:
Operator | Alias | Description |
---|---|---|
set("var","value") | =("var","value") | Sets variable to value or to another variable. Always needs quotes in first case. |
inc("var") | ++("var") | Increments int var |
dec("var") | --("var") | Decrements int var |
+("var1",var2) | var1+=var2 | |
-("var1",var2) | var1-=var2 | |
/("var1",var2) | var1/=var2 | |
*("var1",var2) | var1*=var2 | |
print(var) | pt(var) | Prints text. No quotemarks needed for variables, but needed for strings. |
concat("var1",var2) | ct("var1",var2) | Concats two strings |
wipe() | refreshes all buffers and resets interpreter | |
in("var") | gets data from keyboard to variable | |
showform() | sf() | shows graphics window, required operator before any other graphic ones |
setformsize(width,height) | sfs(width,height) | sets window size |
die() | exits program | |
drawrect(x,y,w,h) | dw(x,y,w,h) | draw rectangular |
fillrect(x,y,w,h) | fw(x,y,w,h) | draw filled rectangular |
setcolor(r,g,b) | sc(r,g,b) | set color |
drawtext(var,x,y) | dt(var,x,y) | draw text |
drawline(x,y,x1,y1) | dl(x,y,x1,y1) | draw line |
repeat(x); ... endcycle(); | repeats x times | |
if(var1,"= or > or <",var2); ... endif(); | logical operator | |
sleep(val) | sleeps for val milliseconds | |
fillscreen(r,g,b) | fills entire window with color | |
cls() | clears screen and graphics buffer | |
goto(val) | sends interpreter to val expression(!) not the code line, so it's recommended to use newlines properly | |
loadpic("picID","filename.png") | loads image to memory | |
loadpic("picID","filename.png") | loads image to memory | |
drawpic("picID",x,y) | draws image by id | |
drawoval/filloval(x,y,w,h) | draws or fills oval | |
readfile/readfilenobr("variable","filename") | reads file contents to variable; nobr version doesnt read newlines | |
getnetresponse("variable","http://webaddress.com") | reads webpage to variable | |
writefile("file","data") | writes data to file | |
title("titletext") | changes window title | |
noresize() | makes window non-resizable; when repeated, reverses current state | |
rnd(min,max,"var") | sets var to random value between min and max | |
label("text",x,y,w,h) | places scrollable label with text wrap on form | |
textfield("var",x,y,w,h) | places textfield on form. var is a variable in which text from textfield will be placed | |
placebutton("text","isPressedVar",x,y,w,h) | places a button; when pressed, sets variable isPressedVar to 1 | |
time() | unix timestamp |
Variable | Description |
---|---|
pkeycode/pkeychar | Keycodes or chars of pressed keys |
rkeycode/rkeychar | Keycodes or chars of released keys |
clickx/clicky | Mouse click coordinates |
mouseinwindow | 0-mouse is out of window, 1-mouse in window |