Kinook Software Forums

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

Thread Tools Rate Thread Display Modes
Old 03-31-2016, 07:53 PM
mevans mevans is online now
Registered User
Join Date: 04-21-2015
Posts: 31
Echoing command line in %LASTSTEP_OUTPUT%

I don't know if this is a bug or if it's something intentional:

I was trying to capture the output of my Oracle script in %LASTSTEP_OUTPUT%, but I kept getting the command line inserted before the output. I tried various Oracle commands, thinking it was sqlplus that was echoing the command line, and I couldn't find any way to get rid of it. Finally, I went to the Visual Build Oracle action, Advanced tab, and unchecked "Log the command-line that is used." I ran my script again, and there was no command line to be found in%LASTSTEP_OUTPUT%.

So, that solved my immediate problem; however, I find that it can be helpful to have the command line logged in the output window and the LOGFILE. With this solution, I have no record of the command line. My expectation was that "Log the command-line..." would put it in the Output window and the LOGFILE, but not write it to %LASTSTEP_OUTPUT%.

Is this a bug, or perhaps I'm missing some reason for this behavior? Admittedly, I haven't paid attention to other actions that have the option to log the command line, so I don't know if this is consistent or inconsistent with those.
Reply With Quote
Old 03-31-2016, 10:02 PM
kinook kinook is online now
Join Date: 03-06-2001
Location: Colorado
Posts: 5,754
It is intentional that all logged output, including the command-line if that option is checked (or if logging of the default step property is enabled), is included in the LASTSTEP_OUTPUT macro.

What you could do is remove the first line of the output before processing.
Sub vbld_StepDone()

	' remove first line of output, including CR/LF
	out = Application.ExpandMacrosAndScript("%LASTSTEP_OUTPUT%")
	out = Mid(out, InStr(out, vbCrLf)+2)
	Builder.LogMessage "LASTSTEP_OUTPUT with first line removed:"
	Builder.LogMessage out

End Sub
Reply With Quote

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 10:56 AM.

Copyright 1999-2019 Kinook Software, Inc.