At 10:56 AM 11/16/2013, Tony IJntema wrote:

A long time ago, using the first compiler of R:base, I was able to pass
a variable when I started a compiled application

Something like this:

Testapp.exe testvariable

The value 'testvariable' was stored in a variable and could be used in
the program.

I cannot find anything in the help files.
A similar command is described in the run-command, but I don't see how
I can use this in a compiled environment


Tony,

The ability to pass parameters to any R:BASE instance, Runtime, and
compiled application is possible using the "STARTUPPARAMSTRnnn" and
"StartupParamCount" parameters of the GETPROPERTY command.

STARTUPPARAMSTRnnn - Returns the startup parameter value by the number
specified, where "NNNN" in StartupParamStrNNNN is the a number from
0 to STARTUPPARAMCOUNT.

Notes:

. This parameter is used with STARTUPPARAMCOUNT

. If NNNN = 0 (GETPROPERTY APPLICATION StartupParamStr0 VarName),
  then VarName will always contain the executable name with path

. If NNNN > STARTUPPARAMCOUNT then VarName will contain the text:
  "-ERROR-"

-- Example to Display Parameters:

Desktop Shortcut Target contains:
  C:\RBTI\CompApp_ABC.EXE "-v" "-boss"

CLEAR VAR vCount,vParamStr0,vParamStr1,vParamStr2
GETPROPERTY Application StartupParamCount vCount
GETPROPERTY Application StartupParamStr0 vParamStr0
GETPROPERTY Application StartupParamStr1 vParamStr1
GETPROPERTY Application StartupParamStr2 vParamStr2

SET VAR vMessage TEXT = NULL
SET VAR vMessage = +
('EXE NAME:' & .vParamStr0 + (CHAR(13)) ++
 'PARAM 1 :' & .vParamStr1 + (CHAR(13)) ++
 'PARAM 2 :' & .vParamStr2 + (CHAR(13)))
CLS
PAUSE 2 USING .vMessage CAPTION 'Results' ICON INFO +
BUTTON 'Press any key to continue ...' +
OPTION MESSAGE_FONT_NAME Tahoma +
|MESSAGE_FONT_COLOR NAVY +
|MESSAGE_FONT_SIZE 11 +
|THEMENAME Longhorn
RETURN

StartupParamCount - Returns the startup parameter count for the
executable.

Notes:

. This parameter is used with STARTUPPARAMSTRnnn

Example:

GETPROPERTY Application StartupParamCount vParamCount

The above examples and many other parameters are available within
the "Application" Category of R:Docs 9.5!

Very Best R:egards,

Razzak.

www.rbase.com
www.facebook.com/rbase
--
30+ years of continuous innovation!
15 Years of R:BASE Technologies, Inc. making R:BASE what it is today!
--


Reply via email to