The CNF file
Default system configuration variables are built into Shark. They include the contents of the function keys (F1 - F10), the date and time from DOS, various default values, file locations, and other information.
Default values can be changed by means of the Shark configuration file "SHARKNET.CNF", otherwise referred to as the "CNF" file. SHARKNET.CNF is a simple ASCII text file. Shark reads this file at startup, adjusting Shark's default settings as requested by the CNF file. The CNF file is located in the base SHARK folder.
Shark system variables are distinguished from other variables by having a colon as the first character of its name, e.g. :TIME.
To see the contents of a particular system variable, give the ? command followed by the system variable name. To see all system variables, type LIST SYSTEM.
Like memory variables, the values of most system variables, including the Function Keys, are changeable using the = (equal sign) or STORE...TO commands. Except for the Function Keys, default settings can be changed by editing the SHARKNET.CNF file. The Function Keys, on the other hand, are loaded with memvars by each Shark program.
Each of the function keys contains a pre-defined string (shown with LIST SYSTEM), normally read from the CNF file. Using the = command, you can redefine any function key (e.g., :F2="SET DEFAULT TO b;" assigns the string "SET DEFAULT TO b;" to F2). Function keys can be defined as commands or as frequently repeated entries for use in full-screen editing.
In normal use, Function Keys are programmed individually within each Shark program. The CNF must show the function key place-holders, preset with a single space thus:
:F1=" " Contents of function keys :f1 - :f10 are set here. Note that :F2=" " Function Keys cannot be pre-loaded with instructions. They :F3=" " must be set as shown with a 1-character space. This reserves :F4=" " the location so that Function keys can be programmed with a :F5=" " memory variable in this manner:":F1=MEMVAR" where "MEMVAR" is :F6=" " a memory variable. Thus Function keys in Sharkbase are :F7=" " useful - but transient! :F8=" " :F9=" " :F10=" "
These on-the-fly changes redefine function keys only during the current Shark program.
In addition to the function keys, there are a number of other system variables which can be viewed by typing LIST SYSTEM.
:DATE - When you start SHARK it reads the system date from the system clock and stores it to this variable. :TIME - Contains the value of time from the system clock -- updated each time the TIME() function is used. :COMPANY/:TITLE - Used by the REPORT command, these system variables store a default company name and report title. :PICTURE - This system variable contains a default format string for displaying numbers. See FORMAT STRINGS for a list of characters to use to redefine :PICTURE. See also PIC() in the list of functions. :TERMINAL - When in "terminal mode" this system variable sets the correct control codes for the terminal. :KEY - A numeric variable containing the ASCII number generated by the last keystroke. :AVAIL - The number of the next available volume (address) in the selected library file. If :AVAIL = 0, no library is in use. See SET LIBRARY. :FIELD - Contains the position in the Get Table of the variable currently being processed with the READ or BROWSE OFF command. See "Get Tables" and ON FIELD for more information. :VERSION - This system variable contains the version number of your copy of SHARK. :RETRY - In a network, the number of times SHARK will retry to open a locked file or access a locked record. The default is 25; the largest number that can be specified is 65000. If access cannot be achieved within :RETRY attempts, SHARK returns an error. :USER - In a network, every computer must have a line in its SHARKNET.CNF file specifying a unique user number. <number> is an integer. It must be unique to the computer. This setting is not required for a stand-alone computer, only when part of a network of Shark installations. :SERIAL - SHARK serial number. Note: Changing the serial number variable for a session causes no harm, and can be used for storing session variables such as monitor color data, etc.
The following are sections of a typical Shark configuration file (the "CNF" file):
The APPEARANCE section opens SHARK, setting the basic look-and-feel
SET NETWORK off SET DATE TO 'YYYYMMDD' CLS Some additional settings include: [:USER=99 identifies a user in Sharknet multi-user system] [:COLOR=31 sets default screen color to white text on blue background] [:RETRY=15000 in Sharknet multi-user set up, limits number of tries to access a file in use by another. This will stop trying to open the locked file after 1 minute] [:DATE=DATE(8) displays a full 8-character date in ISO format: YYYYMMDD. Dates can be then be reformatted to personal preference such as "2021-April-14"] [:UNDOC=PIC(DATE(8),"XXXX.XX.XX") stores calendar date formatting in an unused location for access by programs] [:TITLE='DEBUG=N'; stores optional subroutines in an unused location for access by programs] [:SERIAL="COLOR 36" ; stores COLOR choices in the unused :SERIAL location for for access by programs. By storing a series of values, many color combinations can be stored in this one location thus "COLOR 28 29 30 31 32"] [:PICTURE SHARK starts with a default currency-type setting of "9999999.99", so it's not always necessary to specify a :PICTURE setting]
The FILES section tells Shark where to find/store its inputs & outputs
Shark text files can be filed in different folders as directed with the FILES/ENDFILES section: FILES *.TXT,C:\TXTFILES\ *.BAK,C:\BAK\ (backup files created while editing Shark PRG program files) *.MSG,C:\MSG\ (message files) *.ERR,C:\ERR\ (error messages) *.LOC,C:\LOC\ (local files used within multi-user systems) *.MEM,C:\MEM\ (memo files) *.SCR,C:\SCR\ (screen data) *.PRG,C:\PRG\ (Shark PRG program files) *.FRM,C:\FRM\ (form files) *.DTA,C:\DTA\ (data files such as starting bank balances) *.CPL,C:\CPL\ (compiled program files) *.DBF,C:\DBF\ (dbf data files) *.NDX,C:\NDX\ (index files) *.INV,C:\INV\ (e.g. customer invoices) *.STM,C:\STM\ (e.g. customer statements) ENDFILES Using FILES/ENDFILES folders organizes & simplifies daily maintenance work!
When running under a DOS-type system, Shark may be configured manually using settings in the FILES part of the CNF settings. Refer to the SET(environment controls) documentation.
SET EXECUTE OFF SET END OFF
In some emulators, under Windows/Linux/or Mac for example, the Function Keys may be configured to simplify daily operations:
:F1="QUIT;" :F2=" " :F3=" " :F4=" " :F5=" " :F6=" " :F7=" " :F8=" " :F9=" " :F10=" "
However, programming the Function Keys is dependent on the emulator host, and may not always be useful.
© Sub Rosa Inc 1992
© Intelligent Webware Partnership 2003