ProgramParameter function not working [RESOLVED]

Mac OSX specific forum
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

ProgramParameter function not working [RESOLVED]

Post by coder14 »

If the program is run from PB using the compiler commandline options or from Terminal, the parameters work. But if an associated file is clicked the program is launched but not parameters are shown?

Is there some setting required for this?
Last edited by coder14 on Sun Dec 18, 2016 11:08 am, edited 1 time in total.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: ProgramParameter function not working

Post by Mistrel »

Note that this feature is provided in the "Compile/Run" tab under "Run executable with:". This feature will only work when the program is run from the IDE and is meant for testing.

If you want a particular feature to persist then set it as variable that you can toggle on or off in your code.
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: ProgramParameter function not working

Post by Fred »

Yes, program parameter are only valid from terminal. To get a double click filename, you need to implement an application delegate with the 'openFiles:' handler.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: ProgramParameter function not working

Post by wilbert »

Windows (x64)
Raspberry Pi OS (Arm64)
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: ProgramParameter function not working

Post by coder14 »

Thanks Fred! And thanks wilbert! That works perfectly even when the instance is running. It solves my IPC problem of trying to tag the running instance with the new launching parameters. :D

So double runs are not allowed by default on Macs, or is it better to indicate that in the plist?
Post Reply