topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 8:19 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Making command line arguments work  (Read 22355 times)

superticker

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 143
    • View Profile
    • Superticker's SU reviews about technology
    • Donate to Member
Making command line arguments work
« 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.

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: Making command line arguments work
« Reply #1 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

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Making command line arguments work
« Reply #2 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..

Boxer Software

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 31
  • Author of the Boxer Text Editor
    • View Profile
    • Boxer Software
    • Read more about this member.
    • Donate to Member
Re: Making command line arguments work
« Reply #3 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.

superticker

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 143
    • View Profile
    • Superticker's SU reviews about technology
    • Donate to Member
Re: Making command line arguments work
« Reply #4 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.

superticker

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 143
    • View Profile
    • Superticker's SU reviews about technology
    • Donate to Member
Re: Making command line arguments work
« Reply #5 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.

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: Making command line arguments work
« Reply #6 on: June 15, 2007, 11:11 AM »
I can't get it to output to a file either.

Carl

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Making command line arguments work
« Reply #7 on: June 15, 2007, 01:23 PM »
Can you try this new build:
https://www.donation...ormLetterMachine.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!)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Making command line arguments work
« Reply #8 on: June 16, 2007, 10:26 AM »
cough cough.. no one tried it??

superticker

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 143
    • View Profile
    • Superticker's SU reviews about technology
    • Donate to Member
Re: Making command line arguments work
« Reply #9 on: June 16, 2007, 11:38 AM »
Can you try this new build:
https://www.donation...ormLetterMachine.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:

  • If the application window is closed, treat that as pushing the [cancel] button so that nothing is written--not even a blank file.

  • 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.

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?
« Last Edit: June 16, 2007, 11:42 AM by superticker »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Making command line arguments work
« Reply #10 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.

superticker

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 143
    • View Profile
    • Superticker's SU reviews about technology
    • Donate to Member
Auto saving tree and variable files
« Reply #11 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.
« Last Edit: June 16, 2007, 12:57 PM by superticker »