VS:DidCancel

From Vectorworks Developer
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Function DidCancel detects whether the Cancel button in a predefined dialog was pressed. DidCancel is intended for use with conditional statements to signal that a cancel event has occurred.

FUNCTION DidCancel : BOOLEAN;
def vs.DidCancel():
    return BOOLEAN

Example

VectorScript

PROCEDURE Example;
VAR
i : INTEGER;
BEGIN
i := IntDialog('Enter an integer:', '0');
IF NOT DidCancel THEN BEGIN
i := i*3;
Message(i);
END;
END;
RUN(Example);

Python

def Example():
	i = vs.IntDialog('Enter an integer:', '0');
	if not vs.DidCancel():
		i = i*3
		vs.Message(i)
Example()

Version

Availability: from All Versions