#1
|
|||
|
|||
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 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. |
|
|