## Configuration Keyed String Array

When coming up sm32 needs to:
1. get the dsz - to allocate memory and then dim the CONFIG KSA
2. load the CONFIG KSA from somewhere

### Linux - add Linux Documentation here

### Windows - [sm32, sm32 conname, sm32 pfile.sm32]

Sm32 under windows can have a single parameter:

Parameter | Example | Result
--- | --- | ---
no parameter | D:\SM32DIR\SM32.EXE | if "sm32.sm32" exists in the current directory this is the same as D:\SM32DIR\SM32.EXE sm32.sm32 if not same as D:\SM32DIR\SM32.EXE default
parameter is registry branch name no .sm32 extention | D:\SM32DIR\SM32.EXE xxx | 1. set the config branch to: HKEY_CURRENT\USER\Software\YDS\SM32\con_xxx 2. gets dsz from registry or 2500000 if no entry 3. uses the registry to load the CONFIG KSA
parameter is a filename name with .sm32 extention | D:\SM32DIR\SM32.EXE xxx.sm32 | 1. get dsz from xxx.sm32 file header or 2500000 if xxx.sm32 file does not exits 2. use the xxx.sm32 file to load the CONFIG KSA

### Modifying the Configuration

There are a number of ways to modify the SM32 configuration:
Options Menu: | The Options menu item allows the user to modify/display the executing or some other existing configuration. This is available under both WINDOWS and LINUX.
Properties under the System Menu: | The current WINDOWS configuration can be modified/displayed by choosing Properties under the System Menu. Use this method to change the console mode FONT's and the keyboard KEY assignments.
From within a Program |
C![all]=CONFIG | Loads the complete currently executed configuration KSA into C! .
SETCONFIG C![ALL] | Sets the complete currently executed configuration KSA from C! . |
D$=CONFIG(S$,I$) | D$ receives the value of the single item I$ in section S$
SETCONFIG S$,I$,D$ | Sets the single item I$ in section S$ to the value D$
LOADCONFIG C$,C![""] | Loads a complete configuration from the configuration FILE or REGISTRY BRANCH named in C$ into C!.
SAVECONFIG C$,C![""] | Saves the complete configuration contained in C! to the configuration FILE or REGISTRY BRANCH named in C$. |  |

Notes:
1. When a configuration is loaded into a KSA, the 1st 8 characters of the KEY is blank filled and is the SECTION. The rest of the KEY is the ITEM.
2. When modifying the executing configuration many of the configuration changes take effect after exiting (BYE) SM32. When a BYE is executed the configuration is updated back to where it came from.
3. You can transfer a configuration from a file to the registry or registy to a file using LOADCONFIG/SAVECONFIG. You may also want to save the executing configuration under a new name with CONFIG/SAVECONGFIG.

## CONFIG KSA Contents
For sample contents: C![ALL]=CONFIG - KSA C!
SECTION | ITEM | DATA | Description
--- | --- | --- | ---
"command" | "xxxx" | "nn" | Allows the compiler command keywords to be changed or synonyms added. ("xxxx" is the new command "nn" is the numeric value of the command.)
"define" | "xxxx" | "vvv" | Allows the programmer to define compile time constants. ("xxxx" is the name of the define "vvv" is the value of the define.)
"device" | "x" | "ssss" | Add a device to SM32. ("x" is the device #. "ssss" is the device string)
"disable" | "close" | "sss" | If "sss"<> "" System Close (x in upper right of window) is disabled if "sss"="menuxxxxx" System Close is disabled and a menu selection with the ID# xxxxx is simulated
"disk_io" | "binary_open" | "bool" | where bool =1 true; bool = 0 false WINDOWS only open STRING files in binary mode. (NO CRLF translation)
"do_seek" | "bool" | where bool =1 true; bool = 0 false WINDOWS only do a seek before all STRING file I/O
"no_dot_sm" | "bool" | where bool =1 true; bool = 0 false If true INDEXED/DIRECT/MKEYED files are contained in a single file. If false data records are placed in a separate file of type .SM
"read_on_extract" | "bool" | where bool =1 true; bool = 0 false If true only extarcts on extracted records cause an ERROR 0, READS DO NOT.
"route_x" | "rrrr" | where x is the ROUTE #,rrrr is the route string (1st byte is type)
"setdisk_x" | "dddd" | where x is the DISK #,dddd is the directory name
"upper_case" | "x" |
where
x = 0 | No Translation
x = 1 | Translate All filenames to UPPER case
x = 2 | Translate All filenames to LOWER case
"write_without_key" | "x" | where x is 0 or 1
"function" | "xxxx" | "nn" | Allows the compiler function keywords to be changed or synonyms added. ("xxxx" is the new function "nn" is the numeric value of the function.)
"keyword" | "xxxx" | "nn" | Allows the compiler I/O KEYWORDs to be changed or synonyms added. ("xxxx" is the new I/O KEYWORD "nn" is the numeric value of the I/O KEYWORD.)
"macro" | "M" | "ssss" | Defines a single character MACRO (abreviation for a command).
"message" | "x" | "ssss" | Assigns a string to an error number. Where x is the error number.
"noupdate" | "" | "1" | Stops SM32 from writing back changes to the current configuartion at exit time.
"other" | "xxxx" | "nn" | Allows the compiler other keywords to be changed or synonyms added. ("xxxx" is the new other keyword "nn" is the numeric value of the other keyword.)
"system" | "blockio_page" | "x" | Where x is the number of pages.
"cache_dir" | "dddd" | Where dddd is a directory name for caching programs to disk. If "system","temproot" has been specified the string %system%tempdir% can be the prefix to a directory name.
"cache_time" | "x" | Where x is the number of seconds.
"cache_programs" | "x" | Where x is the number of programs stored in the disk cache (Windows fat client).
"dsz" | "x" | Where x is the total number of bytes in all Data Areas.
"entities" | "x" | Where x maximum active enties.
"fid_type" | "x" | Where x is 1->10 choosing the fid type. (see the config utility)
"fpmult" | "x" | Where x 2->10 or -1 for software FP
"initial_statement" | "ssss" | where ssss is a number SM32 statement that is the 1st executed statement when SM32 comes up
"ip_x" | "y.y.y.y" | This is a information entry - y.y.y.y is the IP address of the xth network interface card
"local_bufferring" | "x" | x is always 0
"loctdiff" | "ss" | The SMDE (in $__SETUP) sets ss to the number of seconds between GMT and the Local Time.
"long_err" | "x" | x=1 for long error messages
"mac_x" | "X-X-X-X-X-X" | This is a information entry - X-X-X-X-X-X is the MAC address of the xth network interface card
"multi_threaded" | "x" | Always 0
"program_buffers" | "x" | # of memory resident programs
"rcall_dir" | "dddd" | The SMDE sets dddd to a temparory directory name
"shell" | "pppp" | where pppp is the name of the shell that is used with the SCALL command
"sysmenu" | "x" | where [x = 0] No additions to System Menu; [x = 1 or x = 3] Cascade, Web View and Console View; [x = 2 or x = 3] Properties
"tempdir" | "dddd" | If "system","temproot" has been set, dddd will point to a temporay directory (under the temproot) that is unique to this instance of SM32,
"temproot" | "dddd" | Where dddd is the name of a directory in which a directory will be created for the exclusive use of this instance of SM32. The name of the directory will be placed in "system","tempdir"
"unm" | "ss" | Where ss is any user defined string that is available to the programmer as the UNM system variable.(see function UNM)
"uterm" | "edit_keyx" | "vk_kkk,nnn,$XX$" | where x is the edit key #,where kkk is the windows virtual key name, where nnn is the SM32 key label,where $XX$ is the character string input when key is pressed.(also see 'EL'- Edit Key Load Mnemonic)
"function_keyx" | "vk_kkk,nnn,$XX$" | where x is the function key #,where kkk is the windows virtual key name, where nnn is the SM32 key label,where $XX$ is the character string input when key is pressed.(also see 'FL'- Function Key Load Mnemonic)
"mode_x" | "nnn,fff,ll,rr,0" | Console View Font: x is the mode #, nnn is the SM32 name, fff is the windows font name, ll is lines per screen, rr is rows per screen (also see 'SP'- Standard Print, 'CP'- Compressed Print, 'MODE'- Screen Mode)
"scr_ctrl?" | "D" | where ? is a,b,e,f,h,k,u,x or y. D is the decimal value of the KEY used for the equivalent Data General Screen Edit Function (also see Need to KNOW - Console Mode Keyboard in the Quick Start Manual)
"windows_height" | "hhh" | At exit time SM32 stores the Screen Height into hhh
"windows_pos_x" | "xxx" | At exit time SM32 stores the Screen position into xxx
"windows_pos_y" | "yyy" | At exit time SM32 stores the Screen position into yyy
"windows_siz" | "s" | At exit time SM32 stores the Screen size into s 0=Minimized 1=Restored 2=Maximized
"windows_width" | "www" | At exit time SM32 stores the Screen Width into www
"utilprop" | "iiii" | "pppp" | This section is reserved for the SMDE to save properties for Tools/Utilities. iiii is the property name (it usually start with the sm32 program name) and pppp it the value of the property.

If care is taken not to conflict with SM32 data a programmer can add his own data to the configuration. For example if you called your section mysec0 then:

    110 SETCONFIG "mysec0","mykey1",D1$
    115 SETCONFIG "mysec0"+"mykey2",D2$

SEE:
CONFIG SETCONFIG LOADCONFIG SAVECONFIG