~Vamsi
29th January 2003, 22:20
I do not have access to function main. I would like to redefine a define that is defined in the main function. I have access to a function that main calls. Any ideas?

function main()
{
#define v message("original")

v
|* produces - "original"
changev()
v
|* produces - "original" - how to make it "changed"
}

function changev()
{
#undef v
#define v message("changed")
v
|* produces - "changed"
}

jaapzwaan
30th January 2003, 11:58
:confused: I don't understand.

Is changev in an include? How do you compile the include without having the source of main?

If main is in a DLL, then the object is compiled and you cannot change the behavior anymore.

Can you please be more specific in what you have and what you're trying to achieve?

Regards,
Jaap Zwaan

OmeLuuk
30th January 2003, 13:05
I agree with Jaap...
I can imagine that you want to leave the original session script intact, but in that case you should redefine a function call called in the before.program section that is defined in an include. You can redefine the function in a later stage (I think...) thus also overwriting the previous function definition with a copy that gets your redefined define added.function main()
{
before.program()
}
function before.program()
{
itccom0001.call()
}
function itccom0001.call()
{
#undef v
#define v
copied.code.of.standard.call()
}Also look here (http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_macro_definition_preprocessor)