home *** CD-ROM | disk | FTP | other *** search
- /* This program str_test.c created by Hilgraeve, adds data to the */
- /* Runtime Values dialog box for the current session */
-
- /* $Revision: 1.1 $ */
- /* $Date: 1993/04/26 15:22:30 $ */
-
- /* Define main function, which is always the starting point of C programs. */
- /* (The term "void" indicates that the function returns no value.) */
- void main ()
- {
- /* Declare variables */
- long ScriptHandle;
- int ReturnValue;
- int index;
- char Buffer[128];
-
- /* Initialize variables */
- ScriptHandle = 0;
- ReturnValue = 1;
- Index = 0;
-
- /* Establish a link between this script program and HA/Win */
- ScriptHandle = haInitialize(0, 0, 0, 0);
-
- /* Exit if intialization of link with HA/Win failed */
- if (ScriptHandle == 0) exit();
-
- /* Loop until Cancel is pressed */
- while (ReturnValue == 1)
- {
- /* Display message box and obtain data string */
- ReturnValue = haMessageBox(ScriptHandle, "Test",
- "Enter text to put into a data string or CANCEL to exit",
- 127, Buffer, 2);
-
- /* Set Runtime Values dialog data string (index) */
- if (ReturnValue == 1)
- haSetSessionDataString(ScriptHandle, index, Buffer);
-
- /* Go to next data string */
- index = index + 1;
-
- /* Allows only ten data strings */
- if (index >= 10)
- index = 0;
- }
-
- /* Terminate link between HA/Win and script program */
- haTerminate(ScriptHandle, 0);
- }
-
-