home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Demo / PCDUO / data1.cab / Script_Samples / MSGBOX.SCP < prev    next >
Encoding:
Text File  |  2003-11-28  |  1.9 KB  |  63 lines

  1. // MSGBOX.SCP - Sample Script function to demonstrate the usage
  2. // of the MsgBox () function
  3. // Copyright (c) 2001, Vector Networks Limited
  4. // All Rights Reserved
  5. //
  6. // Revision History:
  7. //  6.1 23-Mar-01 DB  - Created.
  8.  
  9. Function Main ()
  10. Dim Value
  11.  
  12.   Value = MsgBox ("Press [OK] to continue", MB_OK | MB_ICONINFORMATION)
  13.   ButtonType (Value)
  14.   Value = MsgBox ("Do you want to continue?", MB_YESNO | MB_ICONQUESTION)
  15.   ButtonType (Value)
  16.   Value = MsgBox ("Do you want to continue?", MB_YESNO | MB_ICONQUESTION)
  17.   ButtonType (Value)
  18.   Value = MsgBox ("Do you want to continue?", MB_YESNOCANCEL | MB_ICONQUESTION)
  19.   ButtonType (Value)
  20.   Value = MsgBox ("Please press a button", MB_OKCANCEL | MB_ICONINFORMATION)
  21.   ButtonType (Value)
  22.   Value = MsgBox ("Please press another button", MB_OKCANCEL | MB_ICONEXCLAMATION)
  23.   ButtonType (Value)
  24.   Value = MsgBox ("Press [OK] to finish", MB_ABORTRETRYIGNORE | MB_ICONINFORMATION)
  25.   ButtonType (Value)
  26.   Value = MsgBox ("Press [OK] to finish", MB_ABORTRETRYIGNORE | MB_ICONQUESTION)
  27.   ButtonType (Value)
  28.   Value = MsgBox ("Press [OK] to finish", MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION)
  29.   ButtonType (Value)
  30.   Value = MsgBox ("Press [OK] to finish", MB_ABORTRETRYIGNORE | MB_ICONSTOP)
  31.   ButtonType (Value)
  32. End Function
  33.  
  34. Function ButtonType (Value)
  35. If IsNumeric (Value) Then
  36.   Print "Value ", Value, " is numeric"
  37.  
  38.   If Value = IDOK Then
  39.     Print "[OK] button pressed")
  40.   Endif
  41.   If Value = IDCANCEL Then
  42.     Print "[Cancel] button pressed")
  43.   Endif
  44.   If Value = IDYES Then
  45.     Print "[Yes] button pressed")
  46.   Endif
  47.   If Value = IDNO Then
  48.     Print "[No] button pressed")
  49.   Endif
  50.   If Value = IDABORT Then
  51.     Print "[Abort] button pressed")
  52.   Endif
  53.   If Value = IDRETRY Then
  54.     Print "[Retry] button pressed")
  55.   Endif
  56.   If Value = IDIGNORE Then
  57.     Print "[Ignore] button pressed")
  58.   Endif
  59. Else
  60.   Print "Unable to determine which button was pressed"
  61. Endif
  62. End Function
  63.