VS:GetEditReal

From Vectorworks Developer
Revision as of 21:50, 27 April 2008 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Description

Returns the numeric value from the specified REAL numeric edit field control.

FUNCTION GetEditReal(
dialogID :LONGINT;
itemID :LONGINT;
editRealType :LONGINT;
VAR value :REAL) : BOOLEAN;
def vs.GetEditReal(dialogID, itemID, editRealType):
    return (BOOLEAN, value)

Parameters

dialogID LONGINT The index of the dialog layout containing the control.
itemID LONGINT The index of the control item.
editRealType LONGINT The type of REAL value being returned.
value REAL The value contained in the field.

Return Value

A BOOLEAN value indicating the success of the operation.

Remarks

does math, handles units, returns false for any error in conversion. For an explanation of editRealType, see the CreateEditReal call

Example

VectorScript

PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT);

PROCEDURE InvalidValue(controlID :INTEGER);
BEGIN
item := -1;
SelField(controlID);
SysBeep;
END;

BEGIN
CASE item OF
SetupDialogC: SetEditReal(dialogID, 11, 3, elevation);
1: IF NOT(GetEditReal(dialogID, 11, 3, elevation)) 
THEN InvalidValue(11);
END;
END;

Python


Version

Availability: from VectorWorks9.0