A startup file is a command file that executes automatically when you launch R:BASE, such as CUST.DAT. A startup file for a custom R:BASE application ensures that users start the application the same way each time. The startup file is usually included in the same directory as the database and application files to start R:BASE, specify settings for the custom application, set up certain environment variables, enter passwords, create temporary tables, and/or close R:BASE when the application is closed.
A startup file can be an R:BASE command file (.DAT, .RMD, .CMD) or an R:BASE application file (.RBA).
Startup files can be specified in two ways:
1. | Desktop Shortcut Properties |
Within the "Target:" field of a desktop icon's shortcut properties, you can specify a startup file. Specify your startup file in the "Target:" field after the R:BASE executable name. Then, separate the R:BASE executable and startup file with a space.
2. | R:BASE Configuration File |
Inside the configuration file a startup file can be specified with the STARTUP parameter. This tells R:BASE to run the specified file when launched. To specify a startup file in the configuration file, you can edit the configuration file directly, or use the "Display" tab within the R:BASE Configuration Settings dialog. To access the Configuration Settings dialog, choose "Settings" > "Configuration Settings" from the main menu bar.
To edit the configuration file directly, start the R:BASE Editor and open the configuration file.
Before the OPTIONS parameter, insert the line STARTUP filespec. For example:
;============================================================
; Launch on Startup
;============================================================
MENU
STARTUP C:\RBTI\RBG11\MainData\NewSet.dat
OPTIONS
Notes:
•If a startup file is specified in both the configuration file and the desktop shortcut, R:BASE executes the commands in the startup files specified in the configuration file first, then any file specified after the R:BASE executable.
•If an RBASE.DAT file is located in the "start in" or "working" directory upon launching R:BASE, the program will always automatically run this file.
•Do not include the following commands in a startup file:
•GATEWAY
•ZIP ROLLOUT
•If you are using CodeLocked procedure files (APP, APX) as the source for your R:BASE custom application, you would create an R:BASE startup file to initialize the procedure file. The startup file would only require two commands, RUN and EXIT:
RUN appname IN appname.apx
EXIT
Examples:
Example 01:
--CONCOMP.DAT
--ConComp Application Startup file using a form as the menu system
IF(CVAL('DATABASE')) <> 'CONCOMP' OR (CVAL('DATABASE')) IS NULL THEN
CONNECT CONCOMP IDENTIFIED BY NONE
ENDIF
CLS
EDIT USING MenuForm
EXIT
Example 02:
--CONCOMP.DAT
--ConComp Application Startup file using codelocked files as the menu system
RUN CONCOMP IN CONCOMP.APX
EXIT
Example 03:
-- Automates the process of connecting to a database in a network environment with SET STATICDB ON, SET FASTLOCK ON, SET ROWLOCKS ON, and SET PAGELOCK OFF.
-- MyApp.DAT Startup Application File
-- Start Fresh
CLEAR ALL VARIABLES
LABEL StartFresh
DISCONNECT
SET QUOTES=NULL
SET QUOTES='
SET DELIMIT=NULL
SET DELIMIT=','
SET LINEEND=NULL
SET LINEEND='^'
SET SEMI=NULL
SET SEMI=';'
SET PLUS=NULL
SET PLUS='+'
SET SINGLE=NULL
SET SINGLE='_'
SET MANY=NULL
SET MANY='%'
SET IDQUOTES=NULL
SET IDQUOTES='`'
SET CURRENCY '$' PREF 2 B
DISCONNECT
SET STATICDB ON
SET ROWLOCKS ON
SET FASTLOCK ON
SET PAGELOCK OFF
SET MESSAGES OFF
SET ERROR MESSAGES OFF
SET ERROR MESSAGE 2495 OFF
CONNECT dbname IDENTIFIED BY ownername
SET ERROR MESSAGE 2495 ON
SET MESSAGES ON
SET ERROR MESSAGES ON
-- Check the availability of database
IF SQLCODE = -7 THEN
CLS
PAUSE 2 USING 'Unable to Connect the Database.' +
CAPTION ' Your Application Caption Here ...' +
ICON WARNING +
BUTTON 'Press any key to continue ...' +
OPTION BACK_COLOR WHITE +
|MESSAGE_FONT_NAME Tahoma +
|MESSAGE_FONT_COLOR RED +
|MESSAGE_FONT_SIZE 11
CLOSEWINDOW
EXIT
ENDIF
-- Enforce Database Default Settings
SET QUOTES='
SET DELIMIT=','
SET LINEEND='^'
SET SEMI=';'
SET PLUS='+'
SET SINGLE='_'
SET MANY='%'
SET IDQUOTES='`'
SET CURRENCY '$' PREF 2 B
SET NULL ' '
SET DATE FORMAT MM/DD/YYYY
SET DATE SEQUENCE MMDDYY
SET DATE YEAR 30
SET DATE CENTURY 19
CLS
EDIT USING ApplicationMainMenu
RETURN
-- End here ...