// determines whether the type and function type value function TReportForm.ControlType (FType: TNrType; FValue: String): Boolean; Var i: integer; function CountSubStr (SubStr, Source: string): Integer; begin result: = 0; while POS (SUBSTR, SOURCE) <> 0 DO Begin INC; Source: = Copy (Source, POS (SUBSTR, SOURCE) Length (SUBSTR), $ 7FFFFFFFF); end;
Begin Result: = true; if ftype = drmoney The begin if countsubstr ('.', fvalue)> 1 Then Result: = false; // '.' greater than 1 for i: = 1 to length (fvalue) do if not not not (FValue [I] in ['0' .. '9', '.', '$']) Then Result: = false; // illegal character if not results if fTYPE = DRNUM Then Begin for i: = 1 to Length (FValue) Do if Not (Fvalue [I] in ['0' .. '9']) Then Result: = false; // illegal character end // drint else if ftype = DRTEL THEN BEGIN IF CountSUBSTR ('-', FVALUE)> 1 Then Res: = false; // '-' greater than 1 for i: = 1 to length (fvalue) do if not (FVALUE [I] in ['0 '..' 9 ',' - ']) Then Result: = false; // illegal character if not results ixit; end // DRTEL ELSE IF fTYPE = DREMAIL THEN BEGIN if Countstr (' @ ', fvalue) <> 1 THEN BEGIN RESULT: = false; // '.' Greater than 1 exit; end; end;