Dialog if examples: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 38: | Line 38: | ||
if is_inch=0 then IMAGE 265, 35, 100, 100, "metric.bmp" | if is_inch=0 then IMAGE 265, 35, 100, 100, "metric.bmp" | ||
</pre> | </pre> | ||
when the variable <b>is_inch=1</b>, show image "inch.bmp", if variable <b>is_inch=0</b> then show image "metric.bmp" |
Revision as of 17:34, 10 March 2025
You can use conditional IF statements to control most of the dialog elements and commands inside a dialog window.
INPUT example with IF statement
first_var=1 if first_var=1 then INPUT 65, 017, 70, 24, w1, 10
will only show the input box when first_var = 1
first_var=1 second_var=1 if first_var=1 then if second_var=1 then INPUT 65, 017, 70, 24, w1, 10
will only show the input box when first_var = 1 and second_var = 1
CHECK example with IF statement
first_var=1 if first_var=1 then CHECK 070, 044, 070, 24, "Cross", dir1, 0
will only show the check box when first_var = 1
first_var=1 second_var=1 if first_var=1 then if second_var=1 then CHECK 070, 044, 070, 24, "Cross", dir1, 0
will only show the check box when first_var = 1 and second_var = 1
IMAGE example with IF statement
is_inch=1 if is_inch=1 then IMAGE 265, 35, 100, 100, "inch.bmp" if is_inch=0 then IMAGE 265, 35, 100, 100, "metric.bmp"
when the variable is_inch=1, show image "inch.bmp", if variable is_inch=0 then show image "metric.bmp"