How do I save process output to a file?

I'm trying to use a command line filter (to be exact, pas2dox to convert Pascal files to those understandable by Doxygen, but that's just a detaul, the issue is "global").

This filter takes a filename as input, and outputs the result to the console.

I can save the output to a variable, but not a file (that would be a feature request placed hereby

Hi

All you need to do in this case is disable recursive expansion of your variable when you write the contents to the file.

Say you variable is called %ProcessOutput% when you want to write this value to a file, reference it like this %!ProcessOutput%. The ! after the first % tells the FB parser not to attempt to recursively expand any variable references within the variable contents. You can find more on this within the variables section of the FB help file.

Hope this helps.

Regards,
Steve

Wow, great, I didn’t know this exclamation mark trick, many thanks It’s not perfect, since the files all start with two lines (“Starting Directory:” and “Parameters:”), but since Doxygen seems to just skip those, everything works fine now!

Hi

You can prevent the “Starting Directory…” and “Parameters…” messages being logged by using Output Monitors.

Add two output monitors (via Runtime tab of the action -> Output Monitors), enable the ‘Use Wildcards’ option and set the behaviour to ‘Suppress any matching log messages’. Set the search strings for the Output Monitors to ‘Starting Directory:’ and 'Parameters:’ respectively.

This will suppress the two offending messages from the log (and your variable that you are logging to), so that the log will only contain the process output.

Regards,
Steve

Again, I have to bow in front of this mighty tool, again it was quite astonishing at what it can do

Glad you’re enjoying FB.

While your exploring some of FinalBuilder’s lesser known features, you may want to have a look at this blog post from Vincent: https://www.finalbuilder.com/Resources/Blogs/tabid/458/EntryId/284/FinalBuilder-Master-Class-Part-1-Hidden-features.aspx

It covers a few features that you might not be aware of which can make your life much easier.

Regards,
Steve