Friday, January 11, 2013

Making Choices in IDE Scripting

If you use IDE Scripting, you probably know that the Print() method shows a dialog containing your specified text and an OK button, but there are times when it would be nice to be able to make an interactive choice during script execution.

In Real Studio 2012r2, we introduced a new IDE Script method called ShowDialog which gives you the ability to create a MessageDialog with up to 3 buttons.

The method signature is:

   Message as String,
   Explanation as String,
   DefaultButtonCaption as String,
   [CancelButtonCaption as String,]
   [AltButtonCaption as String,]
   [Icon as Integer] ) As String

You may pass an empty string to any of the String properties if you want that item to be ignored. The Icon parameter uses the same values as the Icon property of the MessageDialog class.

Note: This method returns a String. The returned value will match the caption of the button that the user pressed.

No comments: