Skip to content

menu GetNum

menu GetNum {name} [default]
Sets
#MenuRes

Also searchable as: menu GetNum

menu GetNum works like menu Get, but when the value is not a number (an empty field, or text), #MenuRes gets default instead. Without a default, the value is left as it is.

A number here is a whole number, optionally with a sign (-5), or a hexadecimal number starting with $.

menu Clear
menu Window Size 180 80
menu Text lbl 10 12 Delay:
menu Edit delay 60 10 100
menu Button ok 10 45 60 25 OK
menu Show
set #MenuButton N/A
while #MenuButton = N/A
wait 1
menu GetNum delay 20 ; 20 when the field is empty or not a number
display ok Delay #MenuRes
halt

See also

Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.

The EasyUO 1.6 behaviour on this page was researched with help from the ScriptUO community: Gaderian's tutorial New Menu Code and how to adapt old scripts and the scripts its members share at scriptuo.com.