Home Shark Introduction Shark Reference Guide Purchase/Download/Contact 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 one particular system variable, give the ? command followed by the system variable name:

? :DATE

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.

By default, Shark will pre-load the function keys if no values are set in the "SHARKNET.CNF" file. The function keys are managed by your PC's keyboard and can be controlled to a limited extent by the user. In general, you will be able to set the function keys to do something useful, but within your system's limits.

In normal use, Function Keys can be set to default values by simply omitting them from the "SHARKNET.CNF" file. In this case, Shark will fill up the"SHARKNET.CNF" file with its own suggestions like this:

:F1             C       5      HELP
:F2             C      10      LIST STRU;
:F3             C       6      WRITE
:F4             C      10      LIST MEMO;
:F5             C       7      BROWSE;
:F6             C       5      STAT;
:F7             C      12      ^wCONT;EDIT;
:F8             C      11      LOCATE FOR
:F9             C       5      FIND
:F10            C       5      EDIT;
The CNF can also be pre-loaded with the programmer's preferred function keys, for example:

:F1="DATE"        
:F2="DIR;"          
:F3="BROWSE;"      
:F4="etc "           
:F5="etc "        
:F6=" "            
:F7=" "            
:F8=" "
:F9=" "
:F10=" "

Function keys can also be changed within a program, but keeping in mind that such 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
*.INV,C:\INVOICES\  (e.g. customer invoices)
*.STM,C:\STMTS\     (e.g. customer statements)
*.TXT,C:\TXTFILES\  (any undefined text output)
*.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)
*.DOC,C:\DOC\       (output to be formatted by OpenOffice or Word)

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, you are able to configure the Function Keys to simplify daily operations:

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

Programming the Function Keys is also dependent on your hardware and emulator, and may not always be as described. Various PCs may have from 8 to 12 Function Keys, but Shark provides for only 10 keys. Some experimentation will be useful!

© Sub Rosa Inc 1992
© Intelligent Webware Partnership 2003