user defined application parameters

For questions and postings not covered by the other forums
User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

user defined application parameters

Postby ghosttie » Sat Oct 15, 2011 3:48 am

I can't get user defined application parameters to work. My command line is:
jade.exe server=singleUser app=TestApp schema=TestSchema path=f:\something\system ini=f:\something\system\jade.ini endJade "something something"
TestApp has an initialize method of:

Code: Select all

init(pSA_Args : HugeStringArray); vars begin if pSA_Args = null then app.msgBox("pSA_Args is null", "Test", 0); else app.msgBox(pSA_Args.display, "Test", 0); endif; end;
pSA_Args is always null.

It doesn't work thin client either.

Anyone have any ideas?
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: user defined application parameters

Postby murray » Sat Oct 15, 2011 4:27 pm

Maybe Jade is being picky about the declaration of the parameter of the intialisation method?
In the manual (RuntimeApps.pdf) it states:

"An exception is raised if the initialize method does not have only one parameter of type Object".

At least see if you can reproduce the example there, on page 23, as a starting point.
Murray (N.Z.)

torrie
Posts: 92
Joined: Fri Aug 14, 2009 11:24 am

Re: user defined application parameters

Postby torrie » Mon Oct 17, 2011 8:40 am

We use the process.getCommandLine to get the full command line and then process it for the parameters e.g.

Code: Select all

sCommandLine := process.getCommandLine(); iPos := sCommandLine.toUpper.pos( " ENDJADE ", 1 ); if iPos = 0 then return 0; else iPos := iPos + 9; // Length of ENDJADE iLength := sCommandLine.length; if iPos < iLength then while iPos > 0 do psaParameters.add( sCommandLine.getNextCommandLineParameter( iPos ) ); iParameterCount := iParameterCount + 1; endwhile; endif; return iParameterCount; endif;
Where the getNextCommandLineParameter method looks for the space delimetered parameters

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: user defined application parameters

Postby BeeJay » Mon Oct 17, 2011 10:15 am

I've only ever used the option where the parameters are automatically built into a HugeStringArray when running a non-GUI application with jadclient.exe.
(I'm not 100% sure, but I believe that this "automatic" option only works when using jadclient.exe to launch a non-GUI application?!?)

For jade.exe applications, I always use the getCommandLine option and then parse it manually, as already mentioned by Torrie.

Cheers,
BeeJay.

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: user defined application parameters

Postby ghosttie » Tue Oct 18, 2011 4:38 am

Thanks guys, process.getCommandLine does the trick.

The documentation seems to imply that it'll work with jade.exe but I guess it only works with jadclient. I've put in a contact asking whether it's a documentation error or a bug.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

DarthVader
Posts: 2
Joined: Tue Sep 06, 2011 10:10 am

Re: user defined application parameters

Postby DarthVader » Wed Oct 19, 2011 9:55 am

the method needs this parameter.

userMethod(initializeParameter : Object);

the object will be a HugeStringArray.


Return to “General Discussion”

Who is online

Users browsing this forum: Google [Bot] and 9 guests

cron