MessageBox function presents the user with a message box and stops processing of the test.

 

Syntax:

returnValue = MessageBox( message, [Button Options], [Icon and Sound] )

 

Parameter:

Description:

message

The string message to display.

[Button Options]

Optional:  The decimal number from the type1 list.

[Icon and Sound]

Optional:  Then decimal number from the type2 list.

returnValue

Decimal number from the return value list.

 

Button Options:

Icon and Sound Options:

Button Return Values:

0 -- OK

1 -- OK/Cancel

2 -- Abort/Retry/Ignore

3 -- Yes/No/Cancel

4 -- Yes/No

5 -- Retry/Cancel

6 -- Cancel/Try Again/Continue

16 -- Icon X, Critical Stop Sound

32 -- Icon Question, Ding Sound

48 -- Icon Exclamation, Exclamation Sound

64 -- Icon Information, Error Sound

80 -- No Icon, Ding Sound

128 -- No Icon, No Sound

1 -- OK

2 -- Cancel

3 -- Abort

4 -- Retry

5 -- Ignore

6 -- Yes

7 -- No

10 -- Try Again

11 -- Continue

Example:

'  Create Message Box Parameter Details:
sMsg = "Button# " + AsString(iButton, 0) _
      + " Icon/Sound# " + AsString(iIconSound, 0)

 
'  Ask User if it is OK to continue Processing Data
iResult = MessageBox( sMsg, iButton , iIconSound )

Returns Any of these Dialog Examples:

 

Button - OK & Icon X, Critical Stop Sound

Button - OK & Icon X, Critical Stop Sound

Button - OK/Cancel & Icon Question, Ding Sound

Button - OK/Cancel & Icon Question, Ding Sound

 Button -Abort/Retry/Ignore & Icon Question, Ding Sound

 Button -Abort/Retry/Ignore & Icon Question, Ding Sound

Button -Yes/No & Icon Question, Ding Sound

Button -Yes/No & Icon Question, Ding Sound

Button -Yes/No/Cancel & Icon Exclamation, Exclamation Sound

Button -Yes/No/Cancel & Icon Exclamation, Exclamation Sound

Button -Retry/Cancel & Icon Information, ERROR Sound

Button -Retry/Cancel & Icon Information, ERROR Sound

Button -Cancel/Try Again/Continue & Icon X, Critical Stop Sound

Button -Cancel/Try Again/Continue & Icon X, Critical Stop Sound

Button -OK & Icon X, No Icon, Ding Sound

Button -OK & Icon X, No Icon, Ding Sound

Button -OK & Icon X, No Icon, No Sound

Button -OK & Icon X, No Icon, No Sound


Example 2:

'  Ask User if it is OK to continue Processing Data
result = MessageBox( "Is it OK to process data for " + instrument.date, 3, 32 )
 
'  If the message box indicates the "No" button was pressed,...
If result = 7 THEN
  '  Send User Warning Message Trading Blox is Aborting Test
  test.AbortSimulation( "Your Finished!" )
ELSE
  '  Send to Print Output & Log Window Processing Success
  PRINT "Processing trades for ", instrument.symbol, _
          + " on ", instrument.date
ENDIF

 

Example 3:

  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '   0 -- OK
  '   1 -- OK/Cancel
  '   2 -- Abort/Retry/Ignore
  '   3 -- Yes/No/Cancel
  '   4 -- Yes/No
  '   5 -- Retry/Cancel
  '   6 -- Cancel/Try Again/Continue
 
  '  Assign Button Option:
  iButton = iButtonOption   '  iButtonOption is Integer Type Parameter
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '  Button -OK & Icon X, No Icon, No Sound
  '   16 -- Icon X, Critical Stop Sound
  '   32 -- Icon Question, Ding Sound
  '   48 -- Icon Exclamation, Exclamation Sound
  '   64 -- Icon Information, ERROR Sound
  '   80 -- No Icon, Ding Sound
  '  120 -- No Icon, No Sound

 
  '  BPV Number Series - Manual Index
  SoundOption[1] = 16   '   Critical Stop
  SoundOption[2] = 32   '   Question Mark
  SoundOption[3] = 48   '   Exclamation Sound
  SoundOption[4] = 64   '   ERROR Sound
  SoundOption[5] = 80   '   No Icon Ding
  SoundOption[6] =128   '   No Icon Sound ?

 
  '  Assign Selection Sound option - iSoundOption is a Selector Type Parameter
  iIconSound = SoundOption[iIconSoundOption + 1]
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '   1 -- OK
    '   2 -- Cancel
    '   3 -- Abort
    '   4 -- Retry
    '   5 -- Ignore
    '   6 -- Yes
    '   7 -- No
    '   10 -- Try Again
    '   11 -- Continue
  '  BPV String Series - Manual Index

  ReturnMeaning[1] = "1 -- OK"
  ReturnMeaning[2] = "2 -- Cancel"
  ReturnMeaning[3] = "3 -- Abort"
  ReturnMeaning[4] = "4 -- Retry"
  ReturnMeaning[5] = "5 -- Ignore"
  ReturnMeaning[6] = "6 -- Yes"
  ReturnMeaning[7] = "7 -- No"
  ReturnMeaning[8] = "8 -- Error"
  ReturnMeaning[9] = "9 -- Error"
  ReturnMeaning[10] = "10 -- Try Again"
  ReturnMeaning[11] = "11 -- Continue"
  ReturnMeaning[12] = "12 -- Error"

 
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '  Create Message Box Parameter Details:
  sMsg = "Button# " + AsString(iButton, 0) _
        + " Icon/Sound# " + AsString(iIconSound, 0)
     
  '  Ask User if it is OK to continue Processing Data
  iResult = MessageBox( sMsg, iButton , iIconSound )
 
  '  Display Message Box Return Value
  PRINT "Message Box Returned: " + ReturnMeaning[iResult]
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Button Returns:

Message Box Returned: 1 -- OK

Message Box Returned: 2 -- Cancel

Message Box Returned: 4 -- Retry

Message Box Returned: 4 -- Retry

Message Box Returned: 7 -- No

Message Box Returned: 6 -- Yes

Message Box Returned: 2 -- Cancel

Message Box Returned: 10 -- Try Again

 

Links:

AbortSimulation

See Also:

General

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 419

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software