Several other critical points that should be emphasized:
1. No complex conditions can be built in IF clause.
if(A == B OR (B == C AND D == E) ) {}
Or I am mistaken? I didn't find anything in documentation.
No that is not included yet. I have not had a need for that yet. So it has not been added.
But you can simulate it with script functions. ( like ADD(..) and OR(..) that return 0/1 )
2. The behavior of script interpreter with IF clause is undefined. One time it threw the exception with totally correct piece which is on the picture 1.
Another time it behaved itself totally unexpectedly with this piece of code.
if(arrayCount($inlsdfiles) == 0)
{
}
else if(arrayCount($indslfiles) == 0)
{
}
else
{
@var $arr[] = PathGetParts($file[$n]);
@var $path[] = {};
arrayAdd($path, $arr[2]);
@var $num = SetSourceSelected($path, 1);
}
During rendering this piece, having found false condition in main IF it skipped all other ELSE clauses and proceeded to the next loop iteration.
The script engine simple.. it is line based.. it is explained somewhere..
So do not compress rows
doing
{ $var = 33;
might fail. ( I think , did not test)
instead do
{
$var = 3;
3. The collation of the real directories differs from the collation of array that FindFiles() function returns as result (see picture 2). And that's awkward.
the script call do not sort it, It returns as Windows returns it. The view is sorted depending on your settings
4. The arrays cannot be initialized as empty ones. E.g.
@var $arr = {};
Even if you write like this it inserts empty array member.
If empty there is no need to init it. But will check.
5. The arrays cannot be initialized with variables. E.g.
@var $arr = {$ini[$n], $ini[$n+1], $ini[$n+2], ...};
Only with literals and it's poor.
Now you are just trying to break it.
Avoid exotic syntaxes, Don't do to much at once.. MultiScript engine support a lot but it is still a very simple script engine.
So, the script language, as well as debugger, is still very raw for real work. IMHO.
It is meant for small script. Not for large applications/tools. There are a real API for that..
I got some large advanced script my self.. So I use it for real work. So it is good enough for that. could it be better ? Ofcouse. And it will be .. If time allows..