Subject Re: [IBO] TIB_Script: Working with Macros
Author Helen Borrie
At 12:47 PM 13-10-02 +0200, you wrote:
>Hi all
>IBO: 4.2.Ga
>D5 Pro
>Win 98 SE
>FB 1.0
>I tried using the MacroXXX properties of TIB_Script but had no success: Just
>assigning a value to this both properties does not trigger the callback
>If I step through the code I can see in TIB_Statement.SysExecuteImmediate
>the first if statement which deals with macros. Since the FOnMacroSubstitute
>is assigned it enters the if statement, but the MacroXXX valus which are
>passed as parameters to the call IB_Parse.SubstMacros are not correct (=
>default values of IB_Connection instead of the values which I have assigned
>to the script component).
>What I am doing wrong?

Possibly you are misunderstanding the usage of macros. They are typically
for substituting repeating strings or blocks of statements, for example in
a replication or fuzzy-text application setup script, and the MacroBegin
and MacroEnd characters need to be set up explicitly in your script where
the macro is wanted, e.g. you might use '$$' for both MacroBegin and
MacroEnd and, in your script, include the placeholder '$$MACRO_1$$'. The
OnMacroSubstitute event is where you handle the substitution. For a simple

if ATextBlock = 'MACRO_1' then
ATextResult := 'CREATE TRIGGER';

What task is your script trying to do with macros? What does the macro
placeholder in your script look like? What is your OnMacroSubstitute code?