Welcome Guest.   Make a donation to an author on the site November 28, 2014, 10:53:41 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the full one-year retrospective report on DonationCoder.com.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Making command line arguments work  (Read 11457 times)
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« on: June 15, 2007, 08:58:16 AM »

I setup a Windows shortcut with the following command line parameters:

[copy or print]
"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.
Logged
cthorpe
Discount Coordinator
Supporting Member
**
Posts: 719


c++thorpe

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: June 15, 2007, 10:29:06 AM »

My guess would be that it should read:

[copy or print]
"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
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: June 15, 2007, 10:44:30 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..
Logged
Boxer Software
Supporting Member
**
Posts: 31


Author of the Boxer Text Editor

View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: June 15, 2007, 10:45:14 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.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: June 15, 2007, 11:04:21 AM »

My guess would be that it should read:
[copy or print]
"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:

[copy or print]
%ProgramFiles%\TheFormLetterMachine\TheFormLetterMachine.exe -out=%HOMEDRIVE%%HOMEPATH%\announcement.07.txt
But that's not working either.  Strange.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: June 15, 2007, 11:08:31 AM »

... try dropping the double quotes altogether from the -out parameter.  Since there are no spaces in the filename, they shouldn't be required.

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.
Logged
cthorpe
Discount Coordinator
Supporting Member
**
Posts: 719


c++thorpe

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: June 15, 2007, 11:11:54 AM »

I can't get it to output to a file either.

Carl
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: June 15, 2007, 01:23:06 PM »

Can you try this new build:
http://www.donationcoder..../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!)
Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: June 16, 2007, 10:26:16 AM »

cough cough.. no one tried it??
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #9 on: June 16, 2007, 11:38:58 AM »

Can you try this new build:
http://www.donationcoder..../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:

  • 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. Sad  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:14 AM by superticker » Logged
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: June 16, 2007, 12:09:05 PM »

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

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

Quote
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.
Logged
superticker
Supporting Member
**
Posts: 138


View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: June 16, 2007, 12:48:08 PM »

Quote
... 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:06 PM by superticker » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.035s | Server load: 0.13 ]