Page 1 of 1

User defined operators

Posted: Tue Dec 03, 2013 1:11 am
by Chris Walton
The following sequence works correctly:

Code: Select all

OPERATOR U0 ( a1 CHAR ) RETURNS CHAR;
RETURN "Test";
END OPERATOR;
U0("T2")
whereas:

Code: Select all

OPERATOR U0 ( a1 CHAR );
END OPERATOR;
U0("T2")
gives the following error:

Code: Select all

ERROR: Could not find operator U0(CHARACTER)

Re: User defined operators

Posted: Wed Dec 04, 2013 1:22 pm
by Dave
U0 does not return a value, so it can't be invoked in an expression. DBrowser assumes that any code which doesn't end with a semicolon must be an expression. Try this:

Code: Select all

CALL U0('T2');