DonationCoder.com Forum

DonationCoder.com Software => Mouser's Zone => The Form Letter Machine => Topic started by: superticker on June 15, 2007, 08:58 AM

Title: Making command line arguments work
Post by: superticker on June 15, 2007, 08:58 AM
I setup a Windows shortcut with the following command line parameters:

"C:\Program Files\TheFormLetterMachine\TheFormLetterMachine.exe" "-out=C:\users\mehl\announcement.07.txt"

However, when I press the [close] button on The Form Letter Machine, the anticipated announcement.07.txt output file is never generated.  What am I doing wrong?  I'm running v1.04.01.
Title: Re: Making command line arguments work
Post by: cthorpe on June 15, 2007, 10:29 AM
My guess would be that it should read:

"C:\Program Files\TheFormLetterMachine\TheFormLetterMachine.exe" -out="C:\users\mehl\announcement.07.txt"

I moved the " from before the -out to before the C:\ at the end.

Carl
Title: Re: Making command line arguments work
Post by: mouser on June 15, 2007, 10:44 AM
i'll look into it and see if i can duplicate the issue.  no reason it shouldn't work, but it's one of those features that doesn't get much testing so you never know..
Title: Re: Making command line arguments work
Post by: Boxer Software on June 15, 2007, 10:45 AM
If Carl's suggestion doesn't work, try dropping the double quotes altogether from the -out parameter.  Since there are no spaces in the filename, they shouldn't be required.
Title: Re: Making command line arguments work
Post by: superticker on June 15, 2007, 11:04 AM
My guess would be that it should read:
"C:\Program Files\TheFormLetterMachine\TheFormLetterMachine.exe" -out="C:\users\mehl\announcement.07.txt"
I moved the " from before the -out to before the C:\ at the end.

I agree.  Thanks for the correction.  But it still doesn't work.  I also tried removing the double quotes altogether using symbolic variables:

%ProgramFiles%\TheFormLetterMachine\TheFormLetterMachine.exe -out=%HOMEDRIVE%%HOMEPATH%\announcement.07.txt
But that's not working either.  Strange.
Title: Re: Making command line arguments work
Post by: superticker on June 15, 2007, 11:08 AM
... try dropping the double quotes altogether from the -out parameter.  Since there are no spaces in the filename, they shouldn't be required.
-Boxer Software (June 15, 2007, 10:45 AM)

Yes, but there's a colon in "C:\" that needs the double quotes.  I tried getting around that with symbolic variables (see earlier reply), but that hasn't worked either.
Title: Re: Making command line arguments work
Post by: cthorpe on June 15, 2007, 11:11 AM
I can't get it to output to a file either.

Carl
Title: Re: Making command line arguments work
Post by: mouser on June 15, 2007, 01:23 PM
Can you try this new build:
https://www.donationcoder.com/Software/Mouser/TheFormLetterMachine/downloads/TheFormLetterMachine.exe

(it seems that in the last version i was testing the -out=stdout option and i was forcing it all the time no matter what you passed on commandling -- oops!)
Title: Re: Making command line arguments work
Post by: mouser on June 16, 2007, 10:26 AM
cough cough.. no one tried it??
Title: Re: Making command line arguments work
Post by: superticker on June 16, 2007, 11:38 AM
Can you try this new build:
https://www.donationcoder.com/Software/Mouser/TheFormLetterMachine/downloads/TheFormLetterMachine.exe

(It seems that in the last version ... the -out=stdout option [was being forced])

I just tried it and it works.  But there's a new issue.  If I close the app dialog box (instead of using the [close] button), TFLM writes a blank output file.  I don't think any app should ever write a blank file.  I would suggest:


I might also add that the protection feature that warns you that you're closing the app without saving the tree sometimes forgets to warn you. :(  I'm wondering if the save should just be automatic on program exit, in which case the "File > Save tree" menu item should be replaced by a "File > Revert changes" to restore (reload w/o saving) the previous tree?
Title: Re: Making command line arguments work
Post by: mouser on June 16, 2007, 12:09 PM
f the application window is closed, treat that as pushing the [cancel] button so that nothing is written--not even a blank file.
agree.

Change the name of the [close] button to [Output & close].  Honestly, I didn't even understand the real function of the [close] button until I read this forum.

yeah, something like that is needed.

I might also add that the protection feature that warns you that you're closing the app without saving the tree sometimes forgets to warn you.

let me fix this, and then decide whether auto saving tree changes should be automatic.
Title: Auto saving tree and variable files
Post by: superticker on June 16, 2007, 12:48 PM
... the protection feature that warns you that you're closing the app without saving the tree sometimes forgets to warn you.

let me fix this, and then decide whether auto saving tree changes should be automatic.

In practice, one does more saving than aborting of changes, so in this sense, auto saving trees and variables on program exit makes sense.  I have an accounting program (Simply Accounting by ACTPAC, excellent product) that works by auto saving.  At first I was concerned, but as long as the File > Revert option is available, it hasn't been a problem, and I have never lost a thing.  I rarely even open the File menu on my accounting program.

There is an issue that when you switch trees, you'll need to auto save on the switch.  That means if you switch back to the original tree and want to revert, you can't (unless the program saves *.bak files for trees).  However, I'm using several tree files and I've never experienced a case where I wanted to do that.  And with the present implementation, doing this maneuver would still be a problem.