YESNO: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
add title info |
||
| Line 1: | Line 1: | ||
[[:Category:Miscellaneous|{{Up}}]] | [[:Category:Miscellaneous|{{Up}}]] | ||
{{Command|syntax=YESNO <prompt> <variable> | {{Command|syntax=YESNO <prompt> <variable> <nowiki>[<caption>]</nowiki> | ||
|description=:Create a Yes/No dialog box. | |description=:Create a Yes/No dialog box. | ||
|param1=<prompt>|param1_desc=Text for the prompt on the dialog. | |param1=<prompt>|param1_desc=Text for the prompt on the dialog. | ||
|param2=<variable>|param2_desc=Variable to set to the response. 1 for "yes", 0 for "no". | |param2=<variable>|param2_desc=Variable to set to the response. 1 for "yes", 0 for "no". | ||
|param3=<nowiki>[<caption>]</nowiki>|param3_desc=Title text for Yes/No dialog box. Use text in double quotes, or a string variable. | |||
}} | }} | ||
===Example=== | ===Example=== | ||
<pre> | |||
YESNO r$, YN1 | |||
YESNO "Do You Want To continue ?", YN2 | |||
</pre> | |||
<pre> | |||
titletext$="Custom Drilling Macro" | |||
txt$="Drill selected points ?\n\n" | |||
yesno txt$, iyesno,titletext$ | |||
if iyesno=0 then goto end | |||
</pre> | |||
:For an example macro see [[Backup_Current_Part]] and [[Calc_Geo_Extents]] | :For an example macro see [[Backup_Current_Part]] and [[Calc_Geo_Extents]] | ||
[[Category:Miscellaneous]] | [[Category:Miscellaneous]] | ||
Latest revision as of 23:58, 19 April 2025
Command
- YESNO <prompt> <variable> [<caption>]
- Create a Yes/No dialog box.
Parameters
- <prompt>
- Text for the prompt on the dialog.
- <variable>
- Variable to set to the response. 1 for "yes", 0 for "no".
- [<caption>]
- Title text for Yes/No dialog box. Use text in double quotes, or a string variable.
Example
YESNO r$, YN1 YESNO "Do You Want To continue ?", YN2
titletext$="Custom Drilling Macro" txt$="Drill selected points ?\n\n" yesno txt$, iyesno,titletext$ if iyesno=0 then goto end
- For an example macro see Backup_Current_Part and Calc_Geo_Extents