Home Shark Introduction Shark Reference Guide Contact/Purchase Menu ☰

CONFIGURING SHARK:

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. Default settings can be changed by editing the SHARKNET.CNF file.

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.

A semicolon (;) in a function key definition indicates a press of the ENTER key. A function key definition that contains a semicolon will be executed when you press the function key.

A quick way to redefine function keys is to type the string to be stored, then press ALT key along with the function key to store the string to. To capture a line of text to move in WRITE, place the cursor at the beginning of the line, then press ALT and the function key to store the text; then move to the new position and press the function key to insert it.

These on-the-fly changes redefine function keys only during the current Shark session. To save changes to function keys or other system variables enter the new definitions in the configuration file, SHARKNET.CNF.

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

The Function Keys may be configured to simplify daily operations:

:F1="QUIT;"
:F2=" "
:F3=" "
:F4=" "
:F5=" "
:F6=" "
:F7=" "
:F8=" "
:F9=" "
:F10=" "

© Sub Rosa Inc 1992
© Intelligent Webware Partnership 2003