INPUT: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
[[:Category:Dialog|{{Up}}]] | [[:Category:Dialog|{{Up}}]] | ||
{{Command|syntax=[[Image:Input.png|right|INPUT]] INPUT <left>, <top>, <width>, <height>, <variable>, [<default>] | {{Command|syntax=[[Image:Input.png|right|INPUT]] INPUT <left>, <top>, <width>, <height>, <variable>, [<default>], {<format>] | ||
|description=:Define the size and position of | |description=:Define the size and position of an input box. | ||
|param1=<left>|param1_desc={{left}} | |param1=<left>|param1_desc={{left}} | ||
Line 8: | Line 8: | ||
|param3=<width>|param3_desc={{width}} | |param3=<width>|param3_desc={{width}} | ||
|param4=<height>|param4_desc={{height}} | |param4=<height>|param4_desc={{height}} | ||
|param5=<variable>|param5_desc= | |param5=<variable>|param5_desc=Variable to be set to the value of the contents of the input box. | ||
|param6=[<default>] |param6_desc= | |param6=[<default>] |param6_desc=optional default value, the input box will be empty if no default is defined | ||
|param7=[<format>] |param7_desc=optional format definition used to display then default value when the default is a variable | |||
}} | }} | ||
===Example=== | ===Example=== | ||
:INPUT 65, 017, 70, 24, w1, 10 | :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]] | :For an example macro see [[Create_Contour]] [[GeoPattern_Part.dlg]] [[GeoPattern_Repeats.dlg]] | ||
[[Category:Dialog]] [[GetCommands.dlg]] [[GeoSavedProcess.dlg]] | [[Category:Dialog]] [[GetCommands.dlg]] [[GeoSavedProcess.dlg]] | ||
===Example with IF statement=== | |||
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