It is probably worth recapping on a few points made when discussing UniVerse's general structure (see The UniVerse Paradigm above):
1. A UniVerse account is a collection of files, and a Universe file is a collection of records.
2. Each record in a UniVerse file is simply a string of ASCII characters, divided into fields, values, and subvalues by field marks (character 254), value marks (character 253) and subvalue marks (character 252) respectively.
3. Each record has a unique 'key', a string of characters which is associated with the record, and can be used to access it directly without reading through every record in the file.
4. Everything in UniVerse is stored in files: each command in the command lanuage is a record in the special VOC file, and each Universe Basic program is a record in a programs file (often called BP for 'Basic Programs').
5. Most files give specific meanings to each field number in their records: for instance, a CUSTOMERS
file may use the first field of each record to store the company name, the second field of each record to store the company phone number, and so on. However, not all files work like this; program files, for instance, simply have one line of UniVerse Basic code on each field: not only don't such records give no positional meaning to their fields, they probably wont even have the same number of fields in each record.
So much, then, is common to all UniVerse files: and for most purposes, UniVerse commands and UniVerse Basic statements can operate in the same way on any file, regardless of its contents.
However, UniVerse files can be further divided into three types. This differenciation is chiefly for performance reasons: the different physical implementations of the three file types makes them suitable to do different jobs efficiently.
The three types are 'directory' files, 'static' files, and 'dynamic' files.
The command to create a file is:
CREATE.FILE filename filetype otherparameters
Convention suggests that the filename
should be uppercase, and words divided using dots, as in CUSTOMER.INVOICES
.
The filetype
is a number, and for historical reasons the range of possible numbers is a little odd. 1 and 19 produce the two slightly different forms of directory file, 2 through 18 exclusively produce the 17 possible types of static file, and 30 produces a dynamic file.
The otherparameters
depend on the filetype
selected, and are examined in more detail below.