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 01-09-2014, 03:59 PM
mbrock mbrock is online now
Registered User
 
Join Date: 08-05-2009
Posts: 9
VBScript/macro issue with Visual Build Pro 8

We recently moved from version 7 of Visual Build Pro to 8.5, and since then we have been seeing a weird issue with a VBScript that we've had in place for a long time.

In a text file, we have a list of the solution files that we want to compile. We have a Global VBScript function that parses this file into a tab-delimited temporary macro, and then another VBScript function that iterates through the macro to compile our solutions in the order listed.

I have confirmed that the first function seems to be reading the text file and creating the macro as expected by writing the macro contents to a file and even opening the file in a binary editor to confirm that it's writing the correct ASCII code for the tabs. But by looking through the logs of what was compiled, it seems the second function is skipping over some of the text in the macro, and that too randomly. By randomly, I mean it does not always skip the same text (solution files to be compiled), and sometimes it doesn't skip at all and compiles everything. Usually if I re-run the same steps again, everything gets compiled.

Here is the function in question:

Code:
Function NextDelimValue(macroName)
' given the name of a macro containing delimited strings (populated via
' AddDelimValue), remove the *first* delimited string from the value
' and return or return Null if the macro does not exist

        Dim macros, macro, pos
	
        Set macros = Application.Macros(vbldMacroTemporary)
	Set macro = macros(macroName)
	If macro Is Nothing Then	' macro doesn't exist, return Null
		NextDelimValue = Null
	Else
		pos = InStr(macro, vbTab)		' find next delimiter
		If pos = 0 Then					' if no more delimiters, return the remaining value
			NextDelimValue = macro.Value
			Set macro = Nothing
			macros.Remove macroName		' and delete the macro
		Else
			NextDelimValue = Left(macro, pos-1)	' retrieve the next value
			macros.Add macroName, Mid(macro, pos+1)		' and remove from the macro
		End If
	End If

End Function
The above function is called in a Set Macro step where we pass the following as the Value: [NextDelimValue("FILE_LIST")].

To re-iterate, we have been using this function and the Visual Build Pro scripts for 7+ years now with no changes to this section. The only recent change is we have upgraded from version 7 to 8.5.

Any insight into this would be greatly appreciated.
Reply With Quote
  #2  
Old 01-09-2014, 06:33 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
http://www.kinook.com/Forum/showthread.php?t=4767
Reply With Quote
  #3  
Old 01-13-2014, 12:23 PM
mbrock mbrock is online now
Registered User
 
Join Date: 08-05-2009
Posts: 9
Thank you very much for the prompt reply. This seems to have resolved our issue and saved hours implementing a work around.

Quote:
Originally Posted by kinook View Post
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 05:28 PM.


Copyright © 1999-2023 Kinook Software, Inc.