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)
-   -   Multiline macro-expanding (https://www.kinook.com/Forum/showthread.php?t=3159)

teognost 10-29-2007 10:14 AM

Multiline macro-expanding
 
I have a macro LIST_NOSIGNIFICANT_CHANGES and the value is:
.ver
.AssemblyFileVersionAttribute
.AssemblyConfigurationAttribute
%INITIAL_VERS%
%END_VERS%
Cultur

When I open it into Macros view-the value appears correctly ,instead %INITIAL_VERS% appears 7.3.0.73 and instead
END_VERS is 7.3.0.79.

I need to make a search in a string (FoundStr),to see if any of the lines from the macro LIST_NOSIGNIFICANT_CHANGES is contained into this string.
In order to do this I have made VBScript step like this:

Set lnc = vbld_AllMacros()("LIST_NOSIGNIFICANT_CHANGES")

a = Split(lnc,vbCrLf)
arraySize = UBound(a)

i=0
For Each arrayElement In a
'Wscript.Echo "Elem "&i&" is :"&a(i)
'verify if current array elem is contained in FoundStr
If InStr(FoundStr,a(i)) Then 'contained,change is non significant
strMessage="Current section contains string "&a(i)&" -change is not significant"
Wscript.Echo strMessage
Exit Sub 'current section does not contain any significant change
Else ' not contained,search for next string from the list with non significant changes
strMessage="Current section does not contain string "&a(i)
Wscript.Echo strMessage
End If
i=i+1
Next

Problem is in this step -the lines %INITIAL_VERS% and %END_VERS% are taken as literal and not as their value.

I tried to avoid this by getting the macro a different way:
strListNoSignificantChanges=Application.ExpandMacr os("%LIST_NOSIGNIFICANT_CHANGES%")
but in such a case the step raises an unknown error,I guess because macro LIST_NOSIGNIFICANT_CHANGES is a multiline one.
Question is -how can I perform the required search with the lines
%INITIAL_VERS%
%END_VERS%
expanded?

kinook 10-29-2007 10:40 AM

strListNoSignificantChanges=Application.ExpandMacr os("%%LIST_NOSIGNIFICANT_CHANGES%%")

teognost 10-29-2007 11:01 AM

Tks a lot,this solved the issue!


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


Copyright © 1999-2023 Kinook Software, Inc.