dharmsan
11th July 2011, 17:24
Hi Baan Experts,

I want to know what the following macro contains:

#define NOT_TARGET_DOC
^ w.sum.type.whfmm7044 <> PICKING_PROD and
^ w.sum.type.whfmm7044 <> HARAIDASHI_SOUKO



#define PICKING_PROD 1
#define HARAIDASHI_SOUKO 2


extern domain tcmcs.int w.sum.type.whfmm7044 |* set barcode.f(1;1) (The domain of the varaible)

This NOT_TARGET_DOC is used in function in a script, but i am unable to get out any understandable from this:

This is used in below function:
function domain tcbool barcode.check( ref string o.mess.code )
{
o.mess.code = ""

|* check range of summary type
if NOT_TARGET_DOC then
o.mess.code = "whfmm7050"
return( false )
endif
}
I want to know that what this macro contains,,,please help me on this ..


also about this macro
#define OORG_SEISAN
^ ( w.sum.type.whfmm7044 = PICKING_PROD )
^ or ( w.sum.type.whfmm7044 = HARAIDASHI_SOUKO )
^ or (( w.sum.type.whfmm7044 = EMER_DIRECT_GENBA )
^ and ( whinh225.oorg = whinh.oorg.production ))

Regards,
Dharmsan

baan_guru
12th July 2011, 12:07
Hi Dharmasan,

Macro's are generally used to replace frequently used statement with relatively shorter identifier, this facilates progrmmer to write neat and shorter code and also avoids repeatative using of big statements.

Macro processor simply replace macro code with its defination before compilation of code. This do not affect the size of compiled object.

In your first case 'NOT_TARGET_DOC' will get replaced with 'w.sum.type.whfmm7044 <> PICKING_PROD and w.sum.type.whfmm7044 <> HARAIDASHI_SOUKO' and "if" will treat it as a condition.

And the same way 'OORG_SEISAN' will get expanded to '( w.sum.type.whfmm7044 = PICKING_PROD ) or ( w.sum.type.whfmm7044 = HARAIDASHI_SOUKO ) or (( w.sum.type.whfmm7044 = EMER_DIRECT_GENBA ) and ( whinh225.oorg = whinh.oorg.production )).


All th Best !!!

dharmsan
12th July 2011, 15:05
Thanks so much brother....