9.0

113
Define a cancel button item. Pressing the Cancel button from a Dialog instruction causes a run-time error.
(Dialog
( ) function call returns 0.)
Parameter Description
X This numeric value is the distance from the left ed
g
e of the screen to the left ed
g
e o
f
the dialog box. It is measured in 1/8ths of the average character width for the
dialog's font.
Y This numeric value is the distance from the to
p
ed
g
e of the screen to the to
p
ed
g
e o
f
the dialog box. It is measured in 1/12ths of the average character width for the
dialog's font.
DX This number value is the width. It is measured in 1/8ths of the average character
width for the dialog's font.
DY This number value is the height. It is measured in 1/12ths of the character hei
g
ht fo
r
the dialog's font.
Field This identifier is the name of the field. The dialogfunc receives this name as string. I
f
this is omitted then the field name is "Cancel".
See Also: Begin Dialog, Dim As UserDialog.
Example
Sub Main
Begin Dialog
UserDialog 200,120
Text
10,10,180,30,"Please push the Cancel button"
OKButton
40,90,40,20
CancelButton 110,90,60,20
End
Dialog
Dim
dlg As UserDialog
Dialog
dlg ' show dialog (wait for cancel)
Debug
.Print "Cancel was not pressed"
End
Sub
CBool Function
Syntax
CBool(Num|$)
Group
Conversion
Description
Convert to a boolean value. Zero converts to False, while all other values convert to True.
Parameter Description
Num|$ Convert a number or string value to a boolean value.
Example
Sub Main
Debug
.Print CBool(-1) 'True
Debug
.Print CBool(0) 'False
Debug
.Print CBool(1) 'True
End
Sub