INPUT: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 45: | Line 45: | ||
Most dialog elements can be used with IF statements, for examples see [[dialog_if_examples]] | Most dialog elements can be used with IF statements, for examples see [[dialog_if_examples]] | ||
[[Category:Dialog]] | [[Category:Dialog]] |
Latest revision as of 11:42, 26 February 2025
Command
- Define the size and position of an input box.
Parameters
- <left>
- Start position measured from the left edge of the dialog.
- <top>
- Start position of measured from the top edge of the dialog.
- <width>
- Width of the control.
- <height>
- Height of the control.
- <variable>
- Variable to be set to the value of the contents of the input box.
- [<default>]
- optional default value, the input box will be empty if no default is defined
- [<format>]
- optional format definition used to display then default value when the default is a variable
Example
- INPUT 65, 017, 70, 24, w1, 10
- INPUT 65, 017, 70, 24, w1, v1
- INPUT 65, 017, 70, 24, w1, v1, 43p
- Note: When the default is given as an explicit number (eg 1.25), then it will be displayed exactly as it is defined in this command.
- INPUT 65, 017, 70, 24, w1, 10 This will show the default value as 10
- INPUT 65, 017, 70, 24, w1, 10.0 This will show the default value as 10.0
- The optional format description is used to display the value when the default is defined using a variable
- The format is defined as 2 digis (number of digits before the decimal place, then number of digits after decimal place)
- followed by any or all of these optional chanracters
- p = decimal point
- l = leading zeros
- t = trailing zeros
- s = sign when positive
- For example, if the default is 12.34 and the format is
- 43p displayed as 12.34
- 43pt displayed as 12.340
- 43pl displayed as 0012.34
- 43plt displayed as 0012.340
- 43ps displayed as +12.34
- For an example macro see Create_Contour GeoPattern_Part.dlg GeoPattern_Repeats.dlg GetCommands.dlg GeoSavedProcess.dlg
Example with IF statement
Most dialog elements can be used with IF statements, for examples see dialog_if_examples