Vasalt is a "programming language" made to see how far i can go using only batch. It's not intended to be a professional language so don't expect big things (building into .exe is not avaliable).
You only need to download vasalt.bat, the other things can be deleted from your download :).
To create a VasaltScript file, name your file to whatever you want and then add .vlt at the end.
In order to execute your file, you must go to the cmd and then type:
vasalt --run <file>.vlt
If you want to check what version of Vasalt are you using type in the cmd the following command.
vasalt --version
If your version is uptodate, you must update vasalt. To do that, go to the cmd andtype:
vasalt --update
If you doubleclick vasalt you will open the cmdline of vasalt, meanwhile opening it from cmd while use the compiler mode.
Other method to run the cmdline is calling it by the cmd.
vasalt --cmd
vasalt --help
Here at Vasalt, to use a command you must use "[]" instead of "()" like in other languages.
Another function of Vasalt is concatenation, so in a specified list of command you can concate arguments.
The following characters may crash your script (depending on witch batch version are you using)
?
Exceptions: Os concatenation allow spaces at the beggining and tabulations.
Variables cannot be concatenated at the moment, to store multiple values on the same line you must create a StringBasedVar.
$myVar Value1
$myStringBasedVar "Value1 Value2"
Basic print scripts
print[Hello World]
$myStringBasedVar "Hello World"
print[$myStringBasedVar]
$myStringBasedVar "How are you"
print[Hello World $myStringBasedVar]
Using os commands you can execute batch commands in a vasalt script.
os[echo 1]
os[cls]
os[exit]
Concat a list of batch commands to be executed.
os[concat
cls
echo 1
echo 2
echo 3
exit
]
Basic script example
print[Waiting 1 second]
wait[1]
print[Time waited succesfully]
Basic script example
$secs = 4
print[Waiting $secs]
wait[$secs]
print[Succesfully waited $secs]
Tag can be changed to any text, it only works to identify the if to be closed and defined.
$boolean true
if $boolean [tag
print[it's true]
#else
print[it's false]
tag]
Params :
equ = equal
neq = not equal
gtr = greater
lss = less
leq = less or equal
geq = greater or equal
$myVar 1
if $myVar neq 0 [tag
print[it's not 0]
#else
print[it's 0]
tag]
Basic function example
function myFunc [
print[Hello world]
>]
>myFunc
Passing args
function myFunc [
{1} argInPos1
print[$argInPos1]
>]
>myFunc "Hello world
print[My arg was $argInPos1]
Variable as argument
$var "Hello world"
function myFunc [
{1} arg
print[$arg]
>]
>myFunc $var
print[The var i sent was $var & the argument i recieved was $arg]
Don't add the .vlt at the end.
import file
import file as f
Spaces are not important here.
=[returnVar] 1+1
=[rV] 1 + 1
print[$returnVar & $rv]
Spaces are very important here.
$num1 1
$num2 5
=[rV] $num1 + $num2
print[rV]
$textSample "works with vars too"
input[returnVar] Did you knew that inputs $textSample
print[$returnVar]
input[rV] Input your age : \
print[$rV]
Makes the code quit running.
quit
$start 1
$end 10
for yourVarIndex|yourContentVar r[$start|$end] [tag
print[$yourVarIndex]
tag]
for i|v r[1|20] [f
print[$i]
f]
$myStr "Hello world this is my string"
for i|v $myStr [f
print[Index : $i & Content $v]
f]
They don't require to use import as, using import will work with them.
They require to use import as.
To import a library you must use import as
import myCoolLibrary as lib
Basic library's functions can only be executed by the name written on the declaration.
function mylib.main [
{1} arg
print[$arg]
]
import mylib
>mylib.main "hello world"
Advancd library's function's name can be assigned by the users using the import as method.
function -#-.main [
{1} arg
print[$arg]
]
import mylib as lib
>lib.main "hello world"