Function ValidNumStr returns TRUE if the specified string can be converted into a numeric value. If TRUE, the numeric value is returned.
FUNCTION ValidNumStr(
str : STRING;
VAR value : REAL): BOOLEAN;def vs.ValidNumStr(str):
return (BOOLEAN, value)| Name | Type | Description |
|---|---|---|
| str | STRING | String value to be checked for numeric validity. |
| value | REAL | Numeric value converted from input string. |
(Joel Sciamma, 2007.01.13):
- Returns TRUE if the specified string can be converted into a numeric value and places the value in the REAL parameter.
- Returns FALSE if the specified string can not be converted into a numeric value and places zero in the REAL parameter.
CASE Item OF
{// OK Button //}
1:BEGIN
IF ValidNumStr(GetField(4),value) THEN BEGIN
Done:=TRUE;
replaceValue:= GetField(6);
IF ItemSel(9) THEN textMode:=2;
IF ItemSel(10) THEN textMode:=4;
IF ItemSel(11) THEN textMode:=8;
IF ItemSel(12) THEN layerMode:=16;
IF ItemSel(13) THEN layerMode:=32;
IF ItemSel(14) THEN caseMode:=1;
END
ELSE SysBeep;
END;str = '5m + 5cm'
ok, num = vs.ValidNumStr( str )
vs.AlrtDialog( num )OK := ValidNumStr(tmpStr, s);
IF (NOT OK) OR (s <= 0) THEN
BEGIN
SysBeep;
SelectEditText(dialogID, 4);
1: BEGIN
IF method = 1 THEN BEGIN
GetItemText(dialogID, 6, tmpStr);
OK := ValidNumStr (tmpStr, nSegs);
IF (NOT OK) OR (nSegs < 1) THEN
BEGIN
Sysbeep;
AlrtDialog (GetPlugInString (3018));
ok := FALSE;
outBearing := 0;
format := 'azimuth';
{Azimuth-Decimal}
if ValidNumStr(inBearingStr, outBearing) then BEGIN
ok := TRUE;
outBearing := Compass2Cad(outBearing);
END;isNumOk, textPtx = vs.ValidNumStr( vs.GetRField( gObjHandle, gObjName, kNNA_TextLocX ) )
isNumOK, textPty = vs.ValidNumStr( vs.GetRField( gObjHandle, gObjName, kNNA_TextLocY ) )Availability: from All Versions