11. Completing a Vision Application : imagename Command--Run a Completed Application
 
Share this page                  
imagename Command--Run a Completed Application
After you create the image, your application is ready to use. Users can run the image at the operating system by specifying the image name and the desired parameters.
Note:  To make things easier for the user, and to allow more control over how the application is used, you can also create a command to include the application image and the parameters. See Creating a Command for an Imaged Application for details.
VMS: To run the image, use run imagename. Because the run command only accepts one argument, the executable name, you must define the image as a DCL foreign command to run the image with any of the other parameters described in this section. See Creating a Command for an Imaged Application for details.
This command has the following format:
imagename [ -d[v_node::]dbname | -database=[v_node::]dbname
             | -nodatabase ] [-uusername] [framename |[-p]procname]
             [-noforms |-forms] [SQL option flags] [-Ggroupid] [-Rrolename]
             [-constants_file='filename'][-a application_specific_parameter
             {application_specific_parameter}]
imagename
Specifies the name of the application image. By default, the image name is the same as your application name.
-d[v_node::]dbname |
-database=[v_node::]dbname
Runs the application with the database specified by dbname.
The -database flag and the -d flag are synonymous.
The -database or -d flag lets you run the application with a database other than the one the application resides in. The new database must contain the same tables and reports as those used in the application's queries. The new database must also contain the necessary forms, if the application does not use compiled forms.
For example, you can develop an application on a test database and later run it on a production database.
If you are using a database that resides on a remote host, you must specify nodename, followed by two colons. For example:
-dserver1::orderdb
-nodatabase
Starts the application without an open database session. The -nodatabase flag can be used to run an application that does not require access to a database, or an application that starts a database session with the 4GL connect statement.
See the 4GL reference part of this guide for information about database connections.
-uusername
Runs the application as if you were the user represented by username
Files created under this flag are owned by the user actually running the ABF process, not by username.
To use this option, you must be a privileged user.
If you are using Enterprise Access Products, refer to your Enterprise Access documentation before using this parameter.
framename
Runs the application with the specified frame as the top frame
[-p]procname
Runs the application beginning with the procedure represented by procname.
You only need to include the -p flag before the procedure name if you are invoking an image created under a previous release of Vision and the procedure has the same name as a frame in the application.
-noforms|-forms
The -noforms flag lets you run an imaged application without initializing the Forms Runtime System. If the application attempts an operation that requires the forms system, a runtime error is reported.
The -noforms flag can only be used to run applications that do not require any forms. The application can contain forms, if you run the application in a way that does not call the forms. For example, you can start the application from a procedure instead of a frame by specifying the procname on the command line.
The -forms flag to call the forms system is the default and is included only for consistency.
SQL option flags
The SQL option flags are flags that affect the database behavior. Vision passes the flags to the database, which interprets them.
See the sql command description in the System Administrator's Guide for detailed information on these flags. The following SQL option flags are accepted when you run an image:
-f
+U
-l
-x
-Ggroupid
Lets you run or edit the application as a member of the group specified.
VMS: Capital letter flags require double quotes in VMS, for example:
"-Ggroupid"
-Rrolename
Runs the application image with the role specified.
If you specify a role name, you are prompted for the role's password.
VMS: Capital letter flags require double quotes, for example:
"-Rrolename"
-constants_file='filename'
Specifies a file containing values for the application's constants. If the
-constants_file flag is specified, the values in the constants file override the values for the constants stored in the application.
The filename can be the full directory path name for the constants file.
-a application_specific_parameters
Allows the user to pass one or more application-specific parameters to the application.
The -a flag must be the last flag that appears on the command line. There must be a blank space between the -a flag and the first parameter that follows it.
Any characters following the -a flag are passed as a single string of parameters.
Retrieve the parameter values into the application by using the CommandLineParameters()function. See Using Application-specific Parameters for details.
Example: imagename command
To run the order entry application that you imaged as "orders," enter the following command at the operating system prompt:
Windows:
orders
The orders file must be in PATH.
UNIX:
orders
The orders file must be in PATH.
VMS:
runorders
or
run orders.exe
The application runs from the top frame or other default start frame (see Specify a Default Start Frame).
To access the application beginning with the frame AddOrders, the user enters:
Windows:
orders addorders
UNIX:
orders addorders
VMS: The imagename must be defined as a DCL foreign command. See the next section for instructions and an example.
As described in Creating a Command for an Imaged Application, users can run the application with a command that you specify.