|
#1
|
|||
|
|||
Laststep_output
I have a script action and when I try to assign the value of LASTSTEP_OUT to a variable I get errors.
output = Application.ExpandMacrosAndScript("%LASTSTEP_OUTPU T%") What can I do the out put looks like the following: Error in Run Script (VBScript) script code at Line 3, Column 78 (Unterminated string constant) Code: output = Application.ExpandMacrosAndScript("Building list for $/BHWeb........ It appears that the Macro is expanded before being assigned to the variable. Please note that the variable contains quotes which would be perferable to have them. |
#2
|
|||
|
|||
output = Application.ExpandMacrosAndScript("%%LASTSTEP_OUTP UT%%")
http://www.visualbuild.com/Manual/runscript.htm |
#3
|
|||
|
|||
It works now thanks for the quick response!!!!
|
#4
|
|||
|
|||
I have a few other questions relates to this. The following works in a script Step
strAppName = Application.ExpandMacrosAndScript("%%TMP_APP_NAME% %") strSearchString = Application.ExpandMacrosAndScript("%%LASTSTEP_OUTP UT%%") But if I add the same lines to a actions Sub vbld_StepDone() function the value returned is the following strAppName = "%TMP_APP_NAME%" Why would this code work in a Script action and not in a StepDone script. |
#5
|
|||
|
|||
Because macro references (i.e., %ABC%) are expanded before processing the code in a Run Script step, but not for script events and script functions (code in the Script Editor). So you don't need to double the percents for code in the Script Editor.
http://www.visualbuild.com/Manual/scripteditor.htm |
#6
|
|||
|
|||
Thanks, I am now using the Set object to macro functions in both situations based on the info you sent me.
This is just a sample: Dim objAppName, objSearchString 'Set varibles Set objAppName = Application.Macros(vbldMacroTemporary).Item("TMP_A PP_NAME") Set objSearchString = Application.Macros(vbldMacroSystem).Item("LASTSTEP _OUTPUT") 'Search through last output. If InStr(1,UCase(objSearchString.Value), UCase(objAppName.Value)) > 0 Then Application.Macros(vbldMacroTemporary).add "TMP_UNINSTALL_CHECK", "TRUE" End If This seems to work in both script actions and events, unless theres something Im missing. |
#7
|
|||
|
|||
That will be fine if you know the type of macro you need and don't need macros, script, special characters, etc. within the macro value evaluated/expanded.
|
#8
|
|||
|
|||
Can you give an example of special charaters as CR, Linefeeds, Quotes and such do exist. Othere then that I undstand that if I have a macro or script in the value it will not be evaluated in this manner.
|
#9
|
|||
|
|||
By special chars I mean special to VBP (% [ ]): http://www.visualbuild.com/Manual/specialchars.htm
These will be escaped (doubled) by VBP in LASTSTEP_OUTPUT, for instance, and will come through to your code still doubled if the raw macro value is accessed instead of expanding. |
#10
|
|||
|
|||
Great thanks for the help. In my current situation its only reading through the output for version information from VSS and checking if software is installed on a server.
But I see what you are talking about and will use the other if Im evalating scripts or macros. Thanks for clearing that up. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|