3.1 General Format
3.1.1 Screen Layout
A screen consists of a number of “pictures” in a “Screen Definition” file (a text file whose name ends in “.scn”). There is normally one picture for a file called the “masterfile”. There can also be several other pictures for files called “secondary files”, which will be discussed in Section – Secondary Files.
Each picture starts with a line containing the filename for a picture. This special line starts with “:” (colon, space) followed by the table name.
UNIBASE will automatically centre each screen and draw a box around it. Secondary table screens are automatically adjusted to display as many records as possible on the bottom of the screen.
: stock
STOCK FILE MAINTENANCE
Stock No: [stock no]
Description: [description]
Cost Price: [cost price]
Selling Price: [selling price]
Quantity on hand [qty oh]
>
3.1.1.1 Centring Text and Fields
A line on the screen containing both text and fields can be centred by starting the line with a “#”
Note the environment variable $COMPANY. This will be substituted before the line is centred.
Example of Lines Centred on a Screen
: stock
#$COMPANY
#STOCK FILE MAINTENANCE
#STOCK CODE: [stock no]
3.1.1.2 Line Drawing Graphics
UNIBASE can draw straight lines and corners etc on a screen using the “line drawing graphics” characters. To do this you can:
Start a line with “-“. This will draw a single straight line across the screen
Use “~” (for horizontal lines) and “|” (for vertical lines) elsewhere. UNIBASE will use other graphic characters such as Tee’s and Crosses automatically by analysing the surrounding characters.
: stock
#$COMPANY
#STOCK MAINTENANCE
–
STOCK NO: [stock no] | COST PRICE: [cost price]
| SELL PRICE:
[sell price]
QTY ON HAND: [qty oh] ~~
>
Text that is not inside a picture is take to be comments and is ignored. Screen files are text and can be maintained with any text editor.
3.1.2 Options
Sometimes more control over the screen is required that can be expressed in just a picture. To do this there are several screen options. The order in which the options are given doesn’t matter. Options refer to the picture immediately before them. The various options are explained in Section Screen Options
Options are defined by a line starting with a capital letter and are followed either on the same line or subsequent lines with further specifications of the screen option.
If an option uses extra lines, then these are terminated by a line that starts with a “>”.
3.1.3 Secondary Files
“Secondary file” pictures are really two pictures. The first is a heading that appears on the screen underneath the “master file” screen (during data entry) and the second is the screen for each record in the “secondary file”.
A more complex debtor screen with secondary files “orders” and “invoices”:
Example Master and Secondary Screens
: debtors
#$COMPANY
#DEBTOR FILE
–
Debtor Name: [debtor]
Address: [address1]
[address2]
Phone No: [phone]
>
: orders
ORDER NO | Date | VALUE
>
[order no] | [date] |
[value]
>
: invoices
INV NO |DATE | VALUE | DATE PAID
>
[inv no] | [date] | [value] | [paid]
>
3.2 Command Line Options
3.2.1 Debug Options
ubmulti –d screen-name
Using the program option “-d” with the screen program “ubmulti” will give a debug output. As “ubmulti” reads the Data Dictionary and screen format, each line is echoed to the screen. In this way the exact point at which an error occurs can be observed and corrected.
To debug a debtors screen called “debtor.scn”.
Ubmulti –d debtor
3.2.2 Secondary Files Only
ubmulti –s screen-name
This option lets you use secondary files only, ie no master file on the screen. This enables you to specify a list of, for example, debtors on the screen instead of the normal record by record approach.
To display a stock list on the screen from “stock.scn”
ubmulti –s stock
The screen program would look like this:
*STOCK – list stock items on screen
: stock
STOCK NO DESCRIPTION RRP
>
[stock no] [description][rrp]
>
3.2.3 Match Value
ubmulti –m <value>screen-name
This option tells “ubmulti” to find a matching value from the first key in the file and display the record for editing. When you have finished with the record you will exit the screen. This is useful for command files where one specific record is to be edited, eg when printing invoices a particular order number may be edited prior to printing.
To match order number “000100”:
ubmulti –m 000100 invoice
To match a key value “order number,name” where the value is going to contain spaces:
ubmulti –m “000100Mr Sinclair” invoice
3.3 Screen Options
3.3.1 Conditions
C {<table.}
expression
. . .
>
Only records meeting all the conditions will be available. If there are multiple condition sections, a record is available if any one of the condition sections is satisfied.
If a table name is specified then the conditions are applied to that table.
To display only those invoices that haven’t be invoices:
C
[invoiced]=”N”
>
To display only those stock items in Category “I” and cost more than $1,000 or category “G” and cost less than $1,000
C
[category]=”I”
[cost]>1000
>
C
[category]=”G”
[cost]>1000
>
3.3.2 Display Only
D
field
. . .
>
The fields listed are displayed only. They cannot be modified by change or edit.
There should be one filed only per line.
To disallow access to stock codes and their descriptions:
D
[stock code]
[description]
>
3.3.3 Expand Records – Secondary File
E[field] {[filed]…} screen-name
Expand record. This option is only valid for secondary files. It enables the user to expand the current secondary file record into the full screen. The filed(s) are passed, as the match value to ubmulti and the screen name is the name of the screen to use. When a user exists from the expanded screen they are returned to where they were. Using this option you can provide a structured chaining together of many screens (even circular chaining).
NOTE: – The match value uses the primary key so the values must correspond to the values expected for the primary key of the file you are expanding to. The primary key is used so that there is only one record that can be matched and expanded.
It is also possible to use strings (text inclosed in “”) and shell commands (a shell command enclosed in “) instead of fields.
Additional ubmulti flags can be used by placing them just before the screen name.
To expand to a detailed stock screen from a stock line item on a single field primary key:
E [stock no] stock
To expand to a detailed contact notes screen from a contact line on a ultiple filed primary key:
E [enq no][date][time] contact
3.3.4 Group Fields
G group
[field]
. . .
>
Field is part of group no group. Fields are edited top to bottom, left to right in each group. By default, fields are in group 0. Groups are edited in increasing group number.
To place postal address in group 1 and street address in group 2 (everything else on the screen would be in the first group, group 0):
M {B}
Help
>
header
>
options
>
This specifies a pop-up menu. Pop-up menu definitions follow the same rule as those for menus in ubmenu. Refer to the Ubmenu documentation for further information.
To define a pop-up menu within a screen program that displays the date or lists users on the system:
M
>
>
PRINT DATE :::::date;read y
OTHER USERS :::::who;read y
>
3.3.5 Options
O options
Restrict options available on screen:
A – no adds (including repeat)
C – no change – may look up but not change
D – no deletions
S – manual save (F1 must be used to save records)
R – draw a ruler line between records (secondary files only)
T – tail of file i.e go to end of Secondary file rather than start for initial display
To restrict additions, changes and deletions:
ACD
3.3.6 Repeated Fields
R
field
. . .
>
The values in field(s) are repeated from the previous record during add operations.
To repeat a customer order number when entering invoice details:
R
[customer order]
>
3.3.7 Set Fields
S{D}
field expression
. . .
>
If field is blank or zero, copy contents of expression into field.
If field is of type SEQUENCE then the next sequence number is put into the field
If D (SD) is given then the field id displayed only and the value put into field cannot be changed.
To initialise a price field from a stock file (e.g. in an order):
S
[price] [stock,sell price]
>
3.3.8 Updates
U{ACD}
Field <=+-*/>
>
Update value of field. If the field type is numeric then all the operators may be used. If it is not then only ‘=’ may be used. Field may be from another table.
Update may be specified after Add (UA), Change (UC), or Delete (UD) operations. Update may be done to the current file or other files.
To add quantity times amount to a sales field:
UA
[sales]+[qty]*[amount]
>
To clear a filed to 0:
UC
[sales this month]=0
>
To decrease stock on hand:
UC
[stock on hand]-[qty sold]
>
3.3.9 Validations
V{ACD}
Expression
Message
. . .
>
Record validation. The list of expressions is tested. If one of them fails, message is displayed. Records can only be added, changed or deleted if all the conditions given as ‘VA’, ‘VC’ or ‘VD’ respectively are met as well as any in the default ‘V’ section.
To validate an add operation that ensures an operator enters their code and does not backdate an order
VA
[operator]!=” ”
YOU MUST ENTER YOUR OPERATOR CODE
[date]>=[system,date]
YOU CANNOT ENTER DATED BEFORE TODAY
>
3.3.10 Warnings
W{ACD}
expression
message
. . .
>
Record Warning. The list of expressions is tested. If one of them fails, message is displayed. To continue, type Function Key 1 <F1> “OK” this will save the record. To edit the field, type Function Key 2 <F2> “NOT OK” this will let you edit the field in question.
To warn the operator during an add or change operation that they have missed the customer type field:
WA
[custtype:T] !=””
You have not entered a customer type
>
3.3.11 Command Execution
X{ACD} {S}
command
. . .
>
Execute Commands. The list of shell commands is executed after each add (A), change (C), or deleted (D). The list of commands can be any valid commands for our systems. In addition any field definitions on the command line will be substituted before execution. Note that for most systems it is a good idea to place ‘ or “ around fields as they may contain spaces. With XA and XC the additional modifier ‘S’ may also be given. XA will execute immediately after an add, XAS will execute after any secondary files have been edited. Similarly for XC and XCS.
To execute a report after adding a record and some sub records:
XAS
Ubreport –m [order no] invoice | lp
>