PDA

View Full Version : Function field



Rafael M Heise
14-May-2010, 02:32 PM
I'm trying to create a new function field, but when I use this function:



Mid({GE093.ASC_15},1, 30)

I get this error message:


---------------------------
Visual Report Writer
---------------------------
Error: 999, Syntax error.
Invalid command: 'Mid'.

on line: 1 column: 1
---------------------------
OK
---------------------------

Could someone help me to create my function field? Am I doing something wrong?

Dennis Piccioni
14-May-2010, 02:49 PM
Try adding another set of parentheses around the same thing.

Rafael M Heise
14-May-2010, 03:28 PM
Well, I changed my function to


(Mid({GE093.ASC_15},1,30))

but then I get this error message:



---------------------------
Visual Report Writer
---------------------------
Error: 999, Syntax error.
Invalid command: '('.

on line: 1 column: 1
---------------------------
OK
---------------------------

Vincent Oorsprong
15-May-2010, 01:45 AM
Rafael,

If this is all you have put in the function you are missing the RETURN statement.

So;

return (Mid({GE093.ASC_15},1,30))

Rafael M Heise
15-May-2010, 07:23 AM
Yes, that is my problem.

I didn't know that.

Thanks Vincent.

Vincent Oorsprong
15-May-2010, 07:53 AM
Rafael,

In fact the error message is quite clear if you look more closely at it. Mid is not a command, it is a function. Valid commands are listed under Statements in the middle treeview of the function dialog. Return is one of them, like Let and Dim.