|01 Module The |12Delete|12, |12Insert|12, and |12Move|12 gadgets are used to arrange variable expressions in the window to the left of these gadgets. When you click on Insert, the Expression Editor (Chapter 5 in the user manual) is presented for you to define variable expressions. Here you can either define one or more variables or alter the value of a previously defined variable. When you exit the Expression Editor by clicking on OK, the expressions will appear in the window in the Module requester. To insert expressions in a particular place in the list of existing expressions in the window, click on the expression below or above which you wish to insert. When the expression is highlighted, click on |12Insert|12. To delete a variable definition from the list, click on the expression defining the variable displayed inside the window. Then click on |12Delete|12. To move an expression elsewhere in the list, click on it and then Click on the |12Move|12 gadget. To move an expression above its original position, click on the expression above which you want to move. Similarly, to move an expression below its original position, click on the expression below which you want to move. Double clicking on an expression presents the variable and the associated expression in the Expression Editor for editing. |02 Subroutine The |12Delete|12, |12Insert|12, and |12Move|12 gadgets in the requester are used to arrange expressions in the expressions window to the left of them. When you click on Insert, the Expression Editor (see Chapter 5 in the user manual) is presented and you may define variables. When you exit the Expression Editor by clicking on OK, the expressions will appear in the expressions window. To insert expressions in a particular place in the list of existing expression in the window, click on the expression below which you wish to insert. When the expression is highlighted, click on the |12Insert|12 gadget. To delete an expression from the list, click on the expression. Then click on the |12Delete|12 gadget. To move an expression elsewhere in the list, click on the expression. Then click on the |12Move|12 gadget. To move an expression above its original position, click on the expression above which you want to move. To move an expression below its original position, click on the expression below which you want to move. Double clicking on an expression presents it in the Expression Editor for editing. Frequently, you may call a subroutine from a point in the application flow which has a screen background along with display objects that were placed on the background by various icons. If you plan to use a new background and a new set of objects within the subroutine, be sure to return the screen to its original state after the subroutine is completed. For instance, you must store the background image filename in a variable and use it inside a subroutine for returning the screen to its state at which the subroutine was called. In case of display objects that are on the screen at the time the subroutine was called you have the option to not remove or temporarily remove all of them. Temporarily means only while the actions of children of the Subroutine are executing. |03 Quit The Quit icon ends the presentation or course. It returns the user to either the AmigaVision Editor or Workbench screen depending on how the application was executed. If it was executed from the flow editor it will return control to the flow editor. Alternatively, if the application was executed from a runtime module for execution then control will be returned to Workbench. |04 Return The Return icon is used in conjunction with the |12Subroutine|12 icon. When the Return icon is encountered, the application exits the subroutine and continues with the icon following the |12Call|12 icon in the outline which called the subroutine. If no Return is placed as a child to the Subroutine, the Subroutine will execute completely and then automatically return to the icon following the Call icon. As one example, you may want to place the Return inside a Subroutine as a partner to a conditional icon. If the condition is |11true|11, the Return will be executed. If the condition is |11false|11, the Subroutine will continue executing. If Return is encountered and there has been no Call, the application will exit as if it encountered a Quit icon. You have to be careful in the design of your application to be sure that a subroutine is not executed except by a Call icon. For instance, if you have a main module followed by a subroutine icon without a Quit icon in between the two, the subroutine will be executed as if it were another module and the application will exit if it encounters a Return icon. |05 Execute The |12Directory|12 gadget opens the File requester where you specify the filename of the external program. You may also click on the |12Filename|12 field and type in the name of the file to be referenced. You must specify the screen to be displayed while the external program is executing. The choices are |12Custom|12 and |12Workbench|12. You select the Custom option if the external program uses a custom screen. If not you should choose the Workbench option. These two options help AmigaVision manage the display screens properly. For instance, if your external program runs on the Workbench screen then AmigaVision will display the Workbench screen and move the AmigaVision application screen to background so that it is hidden from the viewer. You must also specify the mode of program execution. The Mode options are |12Workbench|12, |12ARexx|12, and |12CLI|12. The |12Workbench|12 option assumes that the external program will be loaded into memory from the Workbench by simulating the double click of left mouse button on the Workbench icon. Sometimes a program has options that can be set within the Tooltypes field of its icon (to set graphics mode, default settings, etc.). Using the Workbench option allows you to take advantage of this. The ARexx mode indicates that you are executing an ARexx script. An important note: the ARexx interpreter |11must|11 be active before you can send any scripts to it. If ARexx is not active, any Execute icons in ARexx mode will be ignored. The |12ARexx|12 mode allows you to select variables for saving the Return Code and Result values returned by ARexx. The Return Code (RetVal) indicates how successful ARexx was at executing your script. Please refer to the ARexx User's Reference Manual for the meaning of the Return Codes. The Result is the value that the ARexx script itself is returning to AmigaVision. Please refer to Appendix B for more information. The |12CLI|12 option executes the commands in the string gadget as if they were typed directly into a CLI window. This means you can also include command line settings in the string, for example: |06 Timer You may have up to nine timers simultaneously. They are identified by numbers from 1 to 9. You may start, stop and restart the timers as necessary. The Timer is like a stopwatch. When started, it begins counting elapsed time. When you stop the timer, it retains the elapsed time. If you restart the timer again, it continues counting from where it left off. If you want it to start counting from zero again then you must choose the Start option instead of Restart. Each of the nine possible timers is identified by a number. You can read the value of a specific timer into a variable by using the |12timer()|12 function in the Expression Editor (see Chapter 5 in the user manual). This function returns elapsed time of a specific timer number in seconds. In general it is a good practice to use >= or <= than == in testing the timer condition as the timer is not updated at every second and it may miss the value while sampling around it. For instance if you state a conditional expression: |12timer(1) == 10.00|12 then the condition might never be True as the timer clock may jump from 9.95 seconds to 10.01 seconds and miss the 10.00 second mark entirely. Thus it is prudent to use the >= or <= tests when you state conditions using the timers. Click on the |12Start/Stop/Restart|12 gadget to select the appropriate action. Click on the |12Timer #|12 field to enter the number of the timer being used. This opens the Specify Value requester (Chapter 5 in the user manual). |07 Resource Control When you click on the |12Directory|12 gadget, the |12File|12 requester is presented. Here you may specify the volume, drawer, and name of the resource files. If you want this file to be entered into the resource file list then click on the |12Insert|12 gadget to the right of the window. To insert a resource in a particular place in the list of existing resources in the window, click on the resource below which you wish to insert. Then, click on |12Insert|12 to place the resource from the Directory field into the Resource Window. Also you can edit a specific filename in the list. When you click on Insert, the file name which appears in the Directory field will be placed into the Resource Window. To delete a resource from the list, click on the resource. Then click on |12Delete|12. To move a resource elsewhere in the list, click on the resource. Click on |12Move|12. To move a resource above its original position, click on the resource above which you want to move. To move a resource below its original position, click on the resource below which you want to move. Select the |12Pause|12 button to cause the application to wait until the files are loaded before executing the next icon. Select the action by clicking on the |12Load|12 or |12Unload|12 gadget. Usually when you need to unload previously loaded files, you can simply use the Copy feature from the pull down menu and copy the Resource icon that was used to load. Selectively delete the files that you do not want unloaded and then select the Unload option. This saves you the labor of specifying each of the files to be unloaded.