MilindV
15th January 2009, 08:20
HI ALL

I have a simple query, can i give message in macro definition?
Please refer to following code.

#define WRITEERR(...) type = get.arg.type(1)
^ if type = 3 then
^ ret.long = get.long.arg(1)
^ if ret.long <> 0 then
^ message("ERROR")
^ endif
^ else
^ ret.str = get.string.arg(1)
^ if isspace(ret.str) then
^ message("ERROR")
^ endif
^ endif

I have also tried using mess() but not working.
I have also declared all variables used in macro before macro definition.

Another doubt is, can I access macro args same as function args?
which I have tried in this case.

I am calling this macro in a function as
WRITEERR(7) |* any numeric value as arg.
or
WRITEERR("")

Thanks All
MilidnV

ravi_mehta
15th January 2009, 08:46
hi milind,

It is allowed to use message as a macro in BAAN.

Check this in your sample code.
#define check message("check successfully")

function main()
{
check
}

Here you will get the message.

Regards
ravi

patvdv
16th January 2009, 22:48
Please do not delete threads that other members have replied to.