![]() |
Comparing two macros
I have two macros, call them A and B, with strings in them and I want a group to run only if they are not equal. I can't figure out how to get that right. In the conditional build rule, I have the macro/expression field set to
%A% <> %B% and the condition set to is true. This skips it every time. If I enclose the expression in square brackets, it gives a macro error. What is the trick to this? |
OK, I've narrowed down the problem a bit more. When I do
["%A%" = "%B%"] as the expression, it works, but only if A and B do not have multiple lines. The real data I need to compare has multiple lines. Anybody have a way to compare multi line strings or strip the newlines before the compare? |
Quoting a macro like this: "%MACRONAME%" when the macro contains multiple lines is the equivalent of "some value
" which is not valid vbscript. You need to do something like this instead: [vbld_AllMacros()("A").Value = vbld_AllMacros()("B").Value] which uses vbld_AllMacros() to evaluate the macro and provide access to the entire value as a string. |
All times are GMT -5. The time now is 12:08 PM. |
Copyright © 1999-2023 Kinook Software, Inc.