PromptValue Function


Microsoft Visual Basic

DgnEngineControl.PromptValue( Values As String, Description As String, Optional X As Long = -1, Optional Y As Long = -1 ) As String


HRESULT IDgnEngineControl::PromptValue (SAFEARRAY (BSTR)* Values, BSTR Descrription, int X, int Y, BSTR * ChosenValue);


Displays a Prompt box with a list of values from which the user can select an option. This allows you to create scripting commands with behavior that is dependent on the user's response. While the Prompt box is active, the user can select a value via mouse or voice.

Argument Description
Values The array of values that will be shown to the user. In order to group values, you can use an empty string. This string appears as a separator element in the array. The values can optionally contain a word's spoken form, separated by a backslash (\).
Description The caption that appears on the prompt box.
X, Y Optional. Screen coordinates of the Prompt-box. If you do not supply these parameters, the Prompt-box will try to determine the most appropriate coordinates, basing on the current caret position.
ChosenValue The return value; this is either the value selected by the user, or an empty string if the user dismissed the prompt box without making a selection.

To access PromptValue, use the EngineControl object. EngineControl.PromptValue returns a string that contains the value chosen by the user, or an empty string if the Prompt-box was dismissed.


Dim Values(7) As String
 'Build a list of commands to display in the prompt dialog
 Values (0) = "milk"
 Values (1) = "cream"
 Values (2) = "eggs"
 Values (3) = "butter"
 Values (4) = "yogurt"
 Values (5) = "cheese"
 Values (6) = "chicken pot pie ingredients"
 Values (7) = "next"
 'set state to null before displaying prompt dialog
 SetState ""
 Dim item As String
 item = EngineControl.PromptValue (Values(), "Available Dairy")