| Products | Purchase | Support | Download | News | About |
|
|
Support - Script Examples |
|||
|
Data Tables Project: Implement a user defined data table for storage of data with several related data fields. The data values may be dynamically retrieved from a host screen as via screen scraping, or come from another source such as a local data file, DDE conversation with another PC application, or from user input. We’ll look at a simple example which uses a dialog box for data entry, a structured table to store the data, and use it for some elementary computation. Thus, this project entails both writing to a table, and reading from it. Algorithm: The structure of the data table(s), including data types, lengths and numbers of fields per record are defined before the table is used. If the initial data in the table is stored in a file, a command is used to load it from the file. In our case, data is entered into a dialog box, placed in the record buffer variable and then written to the table a record at a time. Reading data from the table or searching for values of fields involves reading records from the table into the record buffer variable one at a time and evaluating or storing the values until the correct value is found or the last record is read. Product used in this example: DynaComm Connectivity Series® 9. (release 9.0.0.0) Relevant Commands and Functions:
TABLE DEFINE — Prepares a table for use See Also:
TABLE LOAD — Imports data from a file or the clipboard A Brief Example:
SHOW
TABLE SORT 1 2 ASCEND
DIALOG "Search Results" 3
The first part of this example illustrates creation of a table and writing data to it a record at a time, using a dialog box for data input and a WHILE loop to repeat the process until the user chooses to continue. The TABLE DEFINE command specifies the table, the variable assignment commands put the appropriate strings in the fields of the record buffer, @R1.1 through @R1.6, and the RECORD WRITE command commits them to the table. The TABLE SORT command orders the records in the table appropriately, and the TABLE SAVE command saves them to a file. The second half of this example illustrates a manual search, reading through the structured table a record at a time and summing the data until the last record is read. This is done by using the EOF( ) function and a loop which performs the RECORD READ command. The EOF( ) function becomes true following a Record Read command which fails because the end of the table has been reached, and is False otherwise. Thus, the RECORD READ command needs to occur immediately preceding the EOF( ) conditiona. Note in this example how the RECORD READ command is used once before the WHILE condition is evaluated and is the last command inside the command block before the conditional is evaluated for the next iteration. This example also illustrates the use of Dialog boxes to gather user input and report results, but for a more focused discussion, refer to the example on Dialog Boxes. Further development:
Additional Examples: The Address Book example uses a dialog box to allow data input of contact info, stores this information to a structured table, and sorts it as needed. |
|||
![]() |
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 |
||||||