Nandan
6th July 2007, 23:00
I am trying to understand how token passing mechanism in case of compiler preprocessor works, however I found very little explanation on this topic.
Probably the best examples of token passing can be seen if you compile the exchange scheme in debug mode, and go through the generated script.
This is an example I have taken from one of the scripts generated by exchange
In the initial part of script we have this block
#define BatchLineList1(batl.stmt)
^ batl.stmt( 1, 1,MAP , 10,tcmcs045, 1)
^ batl.stmt( 2, 2,MAP , 20,tcibd001, 1)
below this block we have
| Tables
#define TtblDecl(d1, d2, d3, d4, ttbl, d6) table t##ttbl
BatchLineList1(TtblDecl)
#define InitBatlVars(i, c.ind, cxch, batl, ttbl, indx)
^ b.cxch(1, i) = "cxch"
^ b.batl(i) = batl
^ b.ttbl(1, i) = "ttbl"
^ b.cind(i) = c.ind
^ b.indx(i) = indx
function sub.init.batl1()
{
BatchLineList1(InitBatlVars)
}
|************************************************************************
|********************* Functions per iBaan ERP table ********************
|************************************************************************
function extern create.tables()
{
#define TtblCreate(i, d2, d3, d4, ttbl, d6)
^ db.create.table(t##ttbl##)
^ b.tbid(i) = t##ttbl
long save.bypass
commit.transaction()
save.bypass = error.bypass
error.bypass = 1
BatchLineList1(TtblCreate)
commit.transaction()
error.bypass = save.bypass
}
I am trying to understand how this works. If anybody has explanation or can explain Layman English it would be great help.
Probably the best examples of token passing can be seen if you compile the exchange scheme in debug mode, and go through the generated script.
This is an example I have taken from one of the scripts generated by exchange
In the initial part of script we have this block
#define BatchLineList1(batl.stmt)
^ batl.stmt( 1, 1,MAP , 10,tcmcs045, 1)
^ batl.stmt( 2, 2,MAP , 20,tcibd001, 1)
below this block we have
| Tables
#define TtblDecl(d1, d2, d3, d4, ttbl, d6) table t##ttbl
BatchLineList1(TtblDecl)
#define InitBatlVars(i, c.ind, cxch, batl, ttbl, indx)
^ b.cxch(1, i) = "cxch"
^ b.batl(i) = batl
^ b.ttbl(1, i) = "ttbl"
^ b.cind(i) = c.ind
^ b.indx(i) = indx
function sub.init.batl1()
{
BatchLineList1(InitBatlVars)
}
|************************************************************************
|********************* Functions per iBaan ERP table ********************
|************************************************************************
function extern create.tables()
{
#define TtblCreate(i, d2, d3, d4, ttbl, d6)
^ db.create.table(t##ttbl##)
^ b.tbid(i) = t##ttbl
long save.bypass
commit.transaction()
save.bypass = error.bypass
error.bypass = 1
BatchLineList1(TtblCreate)
commit.transaction()
error.bypass = save.bypass
}
I am trying to understand how this works. If anybody has explanation or can explain Layman English it would be great help.