Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-27-2005, 11:37 AM
jnapier jnapier is online now
Registered User
 
Join Date: 07-29-2003
Posts: 32
Looping through macro

This posts how to loop through the values in a text file http://www.kinook.com/Forum/showthread.php?threadid=231

but what about looping through the values in a macro? I have a macro that contains file names , one on each line. This macro was created from %LASTSTEP_OUTPUT%.

I then want to process each of these files that the macro contains. vbld_NextDelimValue() works on a tab delimited macro, so I am assuming that I need to loop through my original macro and create a tab delimited macro with vbld_AddDelimValue, but I can't figure out how to loop through the original macro.

Thanks for any help.
Reply With Quote
  #2  
Old 05-29-2005, 07:10 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
One option would be to replace newlines with tab chars when initializing your macro. A Run Script step with VBScript code of:

' store last step output, replacing newlines with tabs for compatibility with vbld_NextDelimValue
Application.Macros(vbldMacroTemporary).Add "MY_MACRO", Replace(Application.Macros(vbldMacroSystem)("LASTS TEP_OUTPUT"), vbCrLf, vbTab)

would do it.

Another option would be to copy the vbld_NextDelimValue system script function to project or global scripts, rename it and tweak for your needs (i.e., use vbCrLf instead of vbTab).
Reply With Quote
  #3  
Old 05-30-2005, 03:19 PM
jnapier jnapier is online now
Registered User
 
Join Date: 07-29-2003
Posts: 32
I got this error when running the specified script

Error at Line 1, Column 1 (Object variable not set)
Reply With Quote
  #4  
Old 05-30-2005, 06:45 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
Not sure without seeing your code, but attached is a complete sample that demonstrates the process you want to use.
Attached Files
File Type: bld process_lines.bld (1.6 KB, 1803 views)
Reply With Quote
  #5  
Old 05-31-2005, 01:19 PM
jnapier jnapier is online now
Registered User
 
Join Date: 07-29-2003
Posts: 32
Thanks.
Everything is working as expected.
Reply With Quote
Reply


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 07:31 PM.


Copyright © 1999-2023 Kinook Software, Inc.