*ASK

<< Click to Display Table of Contents >>

Navigation:  Reference > Pre-processor >

*ASK

This invokes a dialog box when parsed.  There are three forms:

[*ask index]

[*ask index = dataset]

{*ask(m) datasetout = dataset]

The first simply asks for a number from the user. Only integer values can be entered.

The second asks for a single selection from the list of options in the dataset.  If the first is chosen index is set to 1, 2 for the second, and so on.

The third asks for selections from the list of options in the dataset.  The chosen selections are stored in the new datasetout as zero or one (0 for not chosen, 1 for chosen).  The size of datasetout will be the same as the size of dataset. The name used for datasetout should be a new dataset name not used previously.

The first two will set the index to null if the user cancels the dialog box.

For example:

[*do Try=1:5]

[*ask ValueWanted]

[*skip 99 null ValueWanted]

[*skip 99 on ValueWanted.lt.0]

[*skip 99 on ValueWanted.gt.600]

[*last Try]

[*99]

[*end Try]

or:

[*data MyList=Europe,Asia,Other]

[*do Try=1:5]

[*ask WhichOne=MyList]

[*skip 99 null WhichOne]

[*last Try]

[*99]

[*end Try]

This will repeat the question until a valid answer is given, but gives up after 5 tries.

[*data MyList=Europe,Asia,Other]

[*ask(m) Chosen=MyList]

[*skip 91 on [Chosen.1].eq.0] !Europe[*91]

[*skip 92 on [Chosen.2].eq.0] !Asia[*92]

[*skip 93 on [Chosen.3].eq.0] !Other[*93]

This command replaces the old Run Control Parameter PP=<> which is still accepted for compatibility.  New CL scripts should use *ASK.