Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-29-2007, 10:14 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
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?
Reply With Quote
  #2  
Old 10-29-2007, 10:40 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
strListNoSignificantChanges=Application.ExpandMacr os("%%LIST_NOSIGNIFICANT_CHANGES%%")
Reply With Quote
  #3  
Old 10-29-2007, 11:01 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
Tks a lot,this solved the issue!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:11 AM.


Copyright © 1999-2023 Kinook Software, Inc.