Database Solutions - Hints & Tips

Tip 13:
Passing Parameters to your Application

The Problem

Sometimes you wish to pass parameters to your application. For example if you want to start your application in debug. Perhaps it crashes in the first form, and you want to know more.

The Solution

When you run your UNIFACE application you will have an application start-up shell, and the icon properties will be something like:

K:\uniface.exe /asn=..\assign\Dev.asn /ini=..\Ini\Dev.ini SevenTwo

where SevenTwo is the name of the application start-up shell.

If you specify at the end of the command line some other parameters, for example

K:\uniface.exe /asn=..\assign\Dev.asn /ini=..\Ini\Dev.ini SevenTwo "DEBUG" "LOCAL"

then the extra parameters ("DEBUG" "LOCAL") are passed as $1 and $2 to the application execture trigger.

Example Usage

You might then have code in the execute trigger to say

if ($1 = "DEBUG") debug

allowing you to go straight into debug without having to change or recompile the application.

compuware_01.gif (3977 bytes)


Copyright ©2000 OCS Consulting plc

dbs_block_logo.gif (2150 bytes)
Refresh Frames