HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)

Appendix A 463
SAMPLE PROGRAMS
BASIC
BASIC
60 REM This program controls source data entry for any forms file.
65 REM It prompts the user for the name of a forms file and opens it
70 REM if possible. It also prompts for the name of a BATCH file and
75 REM opens it if possible. If all is OK, it displays the HEAD FORM
80 REM accepts input, edits the data, and if no errors, writes data
85 REM to the BATCH file. This process continues until the form with
90 REM name $END is encountered or the EXIT function key is pressed.
95 REM
100 REM This program also provides BROWSE control and permits
105 REM modification of the collected data.
110 REM
115 REM The function keys have the following meanings:
120 REM
125 REM f1 f2 f3 f4
130 REM HEAD DELETE PRINT REFRESH
135 REM
140 REM f5 f6 f7 f8
145 REM PREV NEXT BROWSE/ EXIT
150 REM COLLECT
155 REM
160 REM The following variable assignments are used:
165 REM
170 REM Strings:
175 REM
180 REM B$[16] - Name of current Form
185 REM BO$[16] - Saves B$ during BROWSE
190 REM B1$[16] - Name of next Form
195 REM E$[60] - Entry error messages
200 REM M$[150] - General messages
205 REM S$[150] - Status line
210 REM U$[150] - General user input and file names
220 REM
225 REM Integers:
230 REM
235 REM B1 - Batch : O=false; 1=true
240 REM F1 - First time : O=false; 1=true
245 REM W1 - Max window length (150)
250 REM R1 - Saves number of last accessed record in batch file
255 REM D1 - Browse direction: O=forward; 1=backward
260 REM R2 - Local batch record number
265 REM
270 REM E - Errors Flag : O=false; 1=true
275 REM
280 REM
285 REM Com area Array C(1:60)
295 REM C(1) - Status (O=OK; >0 ERROR)
300 REM C(2) - Language (1=BASIC)
305 REM C(3) - Com area length (60)
310 REM C(4) - Com extention length (2000)
315 REM C(5) - Mode
320 REM C(6) - Lastkey (# of last used function key)
325 REM C(7) - Numerrs
330 REM C(8:10) - not used
335 REM C(11:18) - name of current form (packed)