|
General rules and Syndax |
Top Previous Next |
|
General Rules
The structure of the language is very simple. Like a "simple basic". When writing AutoScript the following rules apply.
Letter case matters, for example New and NEW are different variables.
Commands never continue to next line.
Arrays of one dimension are permitted.
We do not have declaration of variables. The appearances of variables into the code declare automaticaly the variables. If a variable appears later as an array variable then converts to an array having as dimension the greatest index.
First element of an array has index of (1) i.e A[1].
All variables are of variant type. They behave relatively on the context they used. For example:
Functions must be calculated in a separate line. For example instead of:
a = 10*value(x,z) + 10
write
a = value(x,z) a = 10*a + 10
Syntax
We give the vocabulary of AutoScript by using small examples
if … then
for … next
for i = 1 to 100 A[i] = i * 10 next
or
j = 2 for i = 1 to 100 step j A[i] = i * 10 next
or
for i = 1 to 100 A[i] = i * 10 if (A[i] = 30) then i = 100 endif next
proc … end
proc showmessage( msg ) call message("the message is :" , msg) end
fun … end
fun final_value(a,b,c)
result = a + b + c
end
call
call showmessage(msg)
or
call showmessage("new message")
return
if ( stop1 = True ) then return endif
start_sql … end_sql
start_sql "query_name" "KOSMOS" SELECT * FROM PRODUCTS end_sql
in the above lines of code we declare the query. The execution takes part by calling the procedure RunEmbSQL
|