Home > Language Reference > Introduction to the Language > Script Structure

Script Structure

Using WinTask Language, you can create complex scripts. The structure of such a script must follow these rules:

  1. At the very beginning of the script, DIM statements declaring the arrays used in the script (if any)
  2. Then Functions and Subs declaration. Note that if sub a() calls sub b(), then the definition of b must precede the definition of a.
  3. Then Main part of the code

If INCLUDE is used, the entire program with all the inclusions must conform to this structure.

See also

Using Functions
Constants and Variables
Using Arrays
Expressions and Operators
Global and Local Variables
Visibility of Variables

Example

'First the Dim statements
Dim column$(100)

'Second the Functions/Subs
Sub Readcolumn(range$)
ReadExcel(fileexcel$,range$,column$())
EndSub

'Third main program and at the beginning of main program the variables assignment
fileexcel$="c:\wttest\data.xlsx"
Readcolumn("A1:A100")
msgbox(column$(2))