home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / windows / terminal / hawtd1 / str_test.c < prev    next >
Encoding:
Text File  |  1993-04-26  |  1.4 KB  |  52 lines

  1. /* This program str_test.c created by Hilgraeve, adds data to the */
  2. /* Runtime Values dialog box for the current session */
  3.  
  4. /*    $Revision: 1.1 $  */
  5. /*    $Date: 1993/04/26 15:22:30 $  */
  6.  
  7. /* Define main function, which is always the starting point of C programs. */
  8. /* (The term "void" indicates that the function returns no value.) */
  9. void main ()
  10.     {
  11.     /* Declare variables */
  12.     long ScriptHandle;
  13.     int ReturnValue;
  14.     int index;
  15.     char Buffer[128];
  16.  
  17.     /* Initialize variables */
  18.     ScriptHandle = 0;
  19.     ReturnValue = 1;
  20.     Index = 0;
  21.  
  22.     /* Establish a link between this script program and HA/Win */
  23.     ScriptHandle = haInitialize(0, 0, 0, 0);
  24.  
  25.     /* Exit if intialization of link with HA/Win failed */
  26.     if (ScriptHandle == 0) exit();
  27.         
  28.     /* Loop until Cancel is pressed */
  29.     while (ReturnValue == 1)
  30.         {
  31.         /* Display message box and obtain data string */
  32.         ReturnValue = haMessageBox(ScriptHandle, "Test",
  33.                        "Enter text to put into a data string or CANCEL to exit",
  34.                        127, Buffer, 2);
  35.  
  36.         /* Set Runtime Values dialog data string (index) */
  37.         if (ReturnValue == 1)
  38.             haSetSessionDataString(ScriptHandle, index, Buffer);
  39.  
  40.         /* Go to next data string */
  41.         index = index + 1;
  42.  
  43.         /* Allows only ten data strings */
  44.         if (index >= 10)
  45.             index = 0;
  46.         }
  47.  
  48.     /* Terminate link between HA/Win and script program */
  49.     haTerminate(ScriptHandle, 0);
  50.     }
  51.  
  52.