| Products | Purchase | Support | Download | News | About |
|
|
Support - Script Examples |
|||
|
Program Flow Project: A script project is expected to grow to encompass more complex operations in the future so it needs to be written in procedures that are easy to port and test. For this example, we’ll define several routines to perform the steps of the Automated Download example, passing variables or defining local variables where appropriate. Algorithm: In this example we will break the project down into several parts, each handled by a routine, and define variables to be passed between the routines where appropriate. Product used in this example: DynaComm Connectivity Series® 9. (release 9.0.0.0) Relevant Commands and Functions:
BEGIN — Begins a command block See Also:
EXECUTE — Starts a script and does not return to the calling script A Brief Example:
SHOW
$time = "02:00:00 AM"
*ConnectSession($Status, $SessionName)
*DownLoadFile($Filename)
*RenameOldFile($Filename)
*Message
This example breaks the project up into a smaller script plus four routines that perform operations for the script. Routines or procedures are defined by a label (starts with an * character) and end with the RETURN command. If any values or variables are to be passed to the routine, these are placed either on the procedure line in parentheses or in an ARGUMENTS command as the first line following the procedure line, as done in the Message routine above. To make use of the procedures, the PERFORM command is issued with the name of the routine and any values or variables to be passed to it. When a variable is passed, as in PERFORM DownLoadFile($filename), it is passed by reference and changes to the variable made in the routine are returned. When a value is passed, as with PERFORM Message("Login Failed"), it is passed by value. A couple of points to note in this example: The routines/procedures can be before or after the PERFORM command which calls them. In our case, we put them at the bottom of the script, and make sure the CANCEL command is used at the end of the main script block so execution does not continue beyond the main SWITCH block. Script execution always begins with the first line of the script, so there is no need to define any special routine such as *Main. The RETURN command returns execution to the command following the last PERFORM command executed, so subroutines can be implemented as illustrated in the DownLoadFile routine above. Further development:
Additional Examples: Several examples use routines to break up a project into managable parts. See the ADDRBOOK example and DDECLNT for further illustration. |
|||
![]() |
Purchase | Contact | Privacy Policy | Terms of Use | Sitemap | Blog |
© 2010 FutureSoft, Inc. All Rights Reserved
|
||||||
|
DynaComm i:filter |
Internet Filtering |
Employee Internet Monitoring |
Managing Internet Access |
Web Filtering |
Internet Monitoring |
DCS Terminal Emulation | TN 3270 | ProComm Plus Replacement | Windows Terminal Emulation | TN 5250 | DynaComm Connectivity Series | MultiView |
||||||