This feels like a silly question but...
Can someone help me with what EnvironmentVariableName() I should look for when doing a open-a-file-with-this-program.
Basically right click and choose open with. I want to use that file in my program. I did actually try listing all environment variables by using the code below but none of the variables was the path to the file nor the file itself.
viewtopic.php?f=12&t=37563&hilit=Enviro ... riableName
Env var for input file
Env var for input file
MacBook Pro (model 7,1) - 2.4GHz Intel Core 2 Duo 4GB - OS X 10.7 Lion.
PB 4.60 RC1
PB 4.60 RC1
Re: Env var for input file
ProgramParameter() did not return anything useful either. Only for console apps?
MacBook Pro (model 7,1) - 2.4GHz Intel Core 2 Duo 4GB - OS X 10.7 Lion.
PB 4.60 RC1
PB 4.60 RC1
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: Env var for input file
I don't understand what you're asking for. Do you want to know which app opens which file type?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: Env var for input file
I think you are looking for this (OSX specific):
http://www.purebasic.fr/english/viewtop ... 19&t=34231
http://www.purebasic.fr/english/viewtop ... 19&t=34231
quidquid Latine dictum sit altum videtur
Re: Env var for input file
Try this, it should show you all the parameters passed to your program. When you do an "open with" and select your program, one of them should be the filename.
Code: Select all
Repeat
P.s = ProgramParameter()
Debug P
Until P = ""
Re: Env var for input file
Thank you freakfreak wrote:I think you are looking for this (OSX specific):
http://www.purebasic.fr/english/viewtop ... 19&t=34231

MacBook Pro (model 7,1) - 2.4GHz Intel Core 2 Duo 4GB - OS X 10.7 Lion.
PB 4.60 RC1
PB 4.60 RC1
Re: Env var for input file
No, it does not. Only on win (and linux?).Trond wrote:Try this, it should show you all the parameters passed to your program. When you do an "open with" and select your program, one of them should be the filename.Code: Select all
Repeat P.s = ProgramParameter() Debug P Until P = ""
MacBook Pro (model 7,1) - 2.4GHz Intel Core 2 Duo 4GB - OS X 10.7 Lion.
PB 4.60 RC1
PB 4.60 RC1
Re: Env var for input file
You didn't state your OS, so I assumed it was windows or linux.tarmsaft wrote:No, it does not. Only on win (and linux?).Trond wrote:Try this, it should show you all the parameters passed to your program. When you do an "open with" and select your program, one of them should be the filename.Code: Select all
Repeat P.s = ProgramParameter() Debug P Until P = ""