FUNCTION convert_to_maths_value
(* SCHEMA mathematical_functions_schema; *)
FUNCTION convert_to_maths_value(val : GENERIC:G) : maths_value;
LOCAL
types : SET OF STRING := TYPEOF (val);
ival : maths_integer;
rval : maths_real;
nval : maths_number;
tfval : maths_boolean;
lval : maths_logical;
sval : maths_string;
bval : maths_binary;
tval : maths_tuple := the_empty_maths_tuple;
mval : maths_value;
END_LOCAL;
IF (schema_prefix + 'MATHS_VALUE') IN types THEN RETURN (val); END_IF;
IF 'INTEGER' IN types THEN ival := val; RETURN (ival); END_IF;
IF 'REAL' IN types THEN rval := val; RETURN (rval); END_IF;
IF 'NUMBER' IN types THEN nval := val; RETURN (nval); END_IF;
IF 'BOOLEAN' IN types THEN tfval := val; RETURN (tfval); END_IF;
IF 'LOGICAL' IN types THEN lval := val; RETURN (lval); END_IF;
IF 'STRING' IN types THEN sval := val; RETURN (sval); END_IF;
IF 'BINARY' IN types THEN bval := val; RETURN (bval); END_IF;
IF 'LIST' IN types THEN
REPEAT i := 1 TO SIZEOF (val);
mval := convert_to_maths_value (val[i]);
IF NOT EXISTS (mval) THEN RETURN (?); END_IF;
INSERT (tval, mval, i-1);
END_REPEAT;
RETURN (tval);
END_IF;
RETURN (?);
END_FUNCTION; -- convert_to_maths_value
Referenced By
Defintion convert_to_maths_value is references by the following definitions:
[Top Level Definitions] [Exit]Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:13:59-04:00