GLIDER WINDOWS version This is a quick guide for users of the WINDOWS version of the GLIDER Simulation Language [1]. This version requires the use of BORLAND Delphi version 4, 5 or 6, that has to be installed prior first use of GLIDER. BORLAND Delphi [4] is also the development tool of GLIDER. To install GLIDER unzip the distribution file (dGLIDER.zip for Delphi4, dGLIDER5.zip for Delphi 5, dGLIDER6.zip for Delphi 6) into hard drive. Make a shortcut to the executable WinGli.exe located in the installation directory (dGLIDER, dGLIDER5 or dGLIDER6). Change the icon to the icon file WinGli.ico located in that directory. Refer to the GLIDER Reference Manual for language syntax and model programming examples. A web version of that Manual can be seen in http://afrodita.faces.ula.ve/Glider/gliweb IMPORTANT
NOTE: Do NOT install GLIDER nor GLIDER programs into directories or
subdirectories whose names contain blank characters, like Program
Files. Current versions of GLIDER will
not recognize them and errors will occur.
<drive>:<path>\dGLIDER\WinGli (dGLIDER5 or dGLIDER6, according to your Delphi installation) GLIDER programs must have extension .gld. Select the program name with the options File|Open in the Main Menu of WinGli. Select Compile to compile the program. The compilation process opens two Console type windows in sequence. Ignore any message of the type "File not Found", press any key when asked for and close manually the last window in case it does not close automatically. If the compilation was successful, a corresponding .exe file must have been created. To run the executable select Run in the Main Menu, or run it outside WinGli as any other WINDOWS executable. The option Complete Compilation is the default selection in the menu Options of the Main Menu. If there were GLIDER compilation errors you can edit the program with the WinGli editor. If there were Delphi compilation errors or in case you can not find the problem in your gld file, change the Compilation mode to Partial Compilation in the Options menu and compile again. With this compilation mode selected, the Glider compiler only generates the ObjectPascal files (<program>.dpr, Pru.pas and Unid1.pas (Unid2...)). Use your Delphi installation to edit the project, using the options File|Open to open the corresponding .dpr project file that was created by WinGli. You can compile and run the project directly in the Delphi IDE, after adding the dGLIDER directory (dGLIDER5 or dGLIDER6) to the Search path list (Project|Options|Directories|Conditional Search path)
Creating and editing a GLIDER program Users of the WINDOWS version have to create and edit their programs using any WINDOWS or MSDOS text editor program, as Notepad or MS Word or WordPad (saving the file as ASCII text with line breaks, with extension .gld) or also using the WinGli editor. GLIDER syntax is case insensitive. Refer to the GLIDER Reference Manual for language syntax and model programming examples. A web version of that Manual can be seen in http://afrodita.faces.ula.ve/Glider/gliweb GLIDER program file names must have extension gld, as myexample.gld NOTE: For very large programs
do not use the WinGli Editor, but WordPad instead, as directed.
Compiling a GLIDER program Complete CompilationUse the program WinGli to compile a GLIDER program, for example myexample.gld, selecting its name with the File|Open option in the main menu.In case that GLIDER precompiler finds any syntax error, an error message is given, indicating line and column numbers where the error was detected and the compilation process ends. Use your text editor for correcting the errors and compile again until successful. If you can not find the error cause, please, contact us via e-mail to the address shown at the end of this section. If no errors were detected, in the program folder, besides the program source file, must be the executable program with the same name but with extension .exe. For example, after selecting the Compile option, the Windows Explorer will show the names myexample.gld and myexample.exe. The GLIDER precompiler must generate
correct Delphi ObjectPascal programs, so the Delphi compilation must not
give any error message. If any error message happens to come and you cannot
find the problem using Delphi as directed in the section Quick
guide and also in the next section, please, send us an e-mail
reporting the case and include if possible the source program to one of
the following addresses: sananes@.ula.ve
Partial Compilation If you have any concern about the Delphi ObjectPascal modules that the GLIDER precompiler generates, select the Partial Compilation mode in the Options menu in Main Menu. In this mode, WinGLI only generates the ObjectPascal modules and leaves them in the program folder. Open the following generated files in the Delphi IDE:
In the Delphi IDE you can compile the corresponding project (<name-prog>.dpr file) using the option Project/Build in the Delphi main menu that completes the process producing the executable file <name-prog>.exe. Before the Delphi compilation you have to add the dGLIDER directory to the Search path list (Project|Options|Directories|Conditional Search path) in the Delphi IDE, so Delphi can find the GLIDER libreries. (dGLIDER5 or dGLIDER6 for Delphi5, Delphi6) The user is responsible for deleting
the intermediate files.
Running a GLIDER program After successful compilation you can run the program. Select the option Run in the Main Menu of WinGli, or enter the program name as a command, with the Run option of the Windows Start Button or open Windows Explorer and double click in the program name (myexample in the example). GLIDER programs start presenting this Control window:
During execution follow the directives given in the Message box -the first one to the left- and then press the next OK button. At the beginning the Message Box shows the Start directive. After clicking the OK button, the GLIDER Main Menu pops allowing for selection of next action, like initialize and run a experiment (model run) or setting options for the experiment. For details about menus, operation
and run options, consult the GLIDER Language Reference Manual [2]
Use the Interrupt button if you want to interrupt normal execution and go into Trace mode. Console Application If your program contains any read instruction from standard Input (Read or Readln) or write to standard Output (Write or Writeln), you must select Console Application in the Options menu in Main Menu. Otherwise, the program will raise a Exception condition when attempting to execute the first read from or write to Console. [Note: During Trace mode you
can interrupt again to go to the main menu and then to end the run. Trying
to return to normal mode is not working properly]
Running programs with graphics GRAPH Instructions WindowWidth:=400; WindowHeight:=400; When the simulation run ends, you can choose the option Close Graphics in the main menu. The closing process grants focus to each graphic window in creation reverse order. For each activated window, the system places a Continue message in the Messages Box of the Control window and then waits until the user press the next OK button. In the meanwhile, the user can save the graphic to a bitmap graphic selecting the File option in the graphic window menu. If any variable data value were outside the graphic limits, the system shows a warning with the message "Graphic Scale was changed" and then the graphic is redraw using the system changed scales. Any way, the closing graphics process is also executed when the user choose the Quit option.
First of all, a set of dependent variables (no more than 14) has to be selected from the left list box, which shows the names of all variables in the selected file. Make the selection using the Windows modes (pressing the Shift key at the last for contiguous variables or with the Crtl key pressed for scattered ones). Then use the arrow button to place them in the right list box. From the right list box you can drop unwanted variables using the Drop button bellow the arrow (the one with the circle crossed off). The independent variable may be reselected from the combo list bellow the dependent variables list box. The graphic caption may be changed as well. After pressing the Accept button, the system displays configuration data in the rightmost table, including pre-selected colors for each variable in the list of dependent variables chosen. Similar data for the independent variable are displayed bellow. The user can change all those values at will. Color may be changed by clicking in the corresponding colored square. Window size (height and width) may be changed before or after accepting the variable selection. When the Apply button is pressed, the graphic window is shown with the size, caption, scales and color chosen. At that point, the user may choose to define a new graphic from the same file, by pressing the now enabled button New Graphic or quit the graphic dialog, pressing the Finish button. After quitting the Graphic dialog, all defined graphics are displayed and then the message Closing Graphics appear in the Message box of the Control window. The system performs the closing process, as described in the previous section (Graph Instructions). When the Main Menu comes back, you can select the Graphic option again to define others graphics from another or the same FILE generated file. Examples of GLIDER programs A collection of examples of GLIDER programs is available in the dGLIDER/DEMOS Folder. (dGLIDER5 or dGLIDER6) The file names of the examples have the form EXE<x>.gld, x = 1,2,3,..20
Differences of implementation with MSDOS version Some characteristics of GLIDER have been implemented differently from the MSDOS version or have not been fully tested. Some are new to the Windows version. Differences on implementation are:
References
MSDOS is registered trademark of Microsoft Corporation. All Borland products are trademarks or registered trademarks of Borland International, Inc. GLIDER: Simulation Language
Financiamiento: Consejo de Desarrollo
Científico y Humanístico CDCHT
May 2001/September 2003.
|