6.1. Prompting Users for a Single Parameter Value

By including the *ASK command within a macro, you can have the macro prompt a user to type in a parameter value.

The format for the *ASK command is

*ASK,Par,Query,DVAL

Where

The *ASK command prints the Query text on the screen and waits for a response. It reads the response from the keyboard except when Mechanical APDL runs in batch mode. (In that case, the response or responses must be the next-read input line or lines.) The response can be a number, a one-to-eight character string enclosed in single quotes, a numeric or character parameter, or an expression that evaluates to a number. Mechanical APDL then sets the value of Par to the read-in response. The following example displays the dialog box shown below, then sets the parameter PARM1 to the value the user enters.

*ask,parm1,'username (enclose the username in single quotes)'

Figure 6.1:  An Example *ASK Dialog Box

An Example *ASK Dialog Box

When you issue *ASK within a macro, Mechanical APDL writes the user's response to File.LOG on the line following the macro name.


Release 18.2 - © ANSYS, Inc. All rights reserved.