Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   macro expansion within a message log (https://www.kinook.com/Forum/showthread.php?t=1105)

wrenczes 06-13-2005 05:00 PM

macro expansion within a message log
 
Hi -

I've got a loop that is extracting strings from perforce comments and loads them into a macro one at a time, which I'm trying to dump out in a Message log, ie in the "message to log" field, I have:

The next entry is %macro%

This fails when %macro% contains a '[' character (Error parsing scripts: unrecoverable parse error at position xxx - expecting "]") . In order to fix the literal problem with the character, I tried changing the entry to this:

The next entry is [vbld_EscapeString(%macro%)]

but this fails as well.

Any ideas?

kinook 06-14-2005 06:36 AM

The value in %macro% will be expanded (evaluated for macro %% or script [] references) before being passed to vbld_EscapeString, and the value returned from vbld_EscapeString will in turn be evaluated for macros and script. You need to escape the string (double literal percent and bracket chars within it) when assigning it to the macro value. In a Run Script step, it would be

Application.Macros(vbldMacroTemporary).Add "macro", vbld_EscapeString(abc)

where abc is a variable containing the raw value to be assigned.


All times are GMT -5. The time now is 09:24 PM.


Copyright © 1999-2023 Kinook Software, Inc.