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

464 AppendixA
SAMPLE PROGRAMS
BASIC
340 REM C(19:26) - name of next form (packed)
345 REM C(27) - Repeat option
350 REM C(28) - NF option
355 REM C(29) - not used
360 REM C(30) - Length of data buffer
365 REM C(31) - not used
370 REM C(33) - Delete flag
375 REM C(34) - Show control
80 REM C(35:42) - not used
385 REM C(43:44) - Number of recs in batch file (double)*
390 REM C(45:46) - Record # in batch file (double)*
395 REM C(47,48) - not used
400 REM C(49) - Terminal file #
405 REM C(56) - Terminal options
410 REM
415 REM *Only c(44) and c(46) are used in this program.
420 REM Therefore, this program cannot handle BATCH files
425 REM that have more than 32768 records.
430 REM
450 REM
451 REM *************************************************************
452 REM
500 REM2 ** DECLARATIONS **
510 DIM B$[16],BO$[16],B1$[16],C$[2]
520 DIM E$[60],M$[150],S$[150],U$[150],X$[2]
530 INTEGER B1,D1,F1,E,I,J,R1,R2,W1,X,Y,P,P1
540 INTEGER C[4560]
900 REM2 ** FUNCTIONS **
905 REM1 * UNPACK INTEGER INTO 2 CHARACTERS *
910 DEF FNU$(X)
915 Y=INT(X/256)
920 X=X-256*Y
925 RETURN CHR$(Y)+CHR$(X)
930 FNEND
950 REM1 * PACK 2 CHARACTERS INTO INTEGER *
955 DEF INTEGER FNP(X$)
960 RETURN NUM(X$[2;1])+NUM(X$[1;1])*256
965 FNEND
1000 REM2 ** ENTRY **
1010 REM *INITIALIZE*
1020 GOSUB 2000
1030 REM1 *COLLECT*
1040 GOSUB 3000
1050 REM1 *EXIT*
1060 GOSUB 5000
1070 END
2000 REM2 <INITIALIZE>
2010 MAT C=ZER
2020 C[2]=l
2030 C[3]=60
2040 C[4]=2000
2050 B1=1
2060 E=O
2070 W1=150
2100 REM1 *OPEN FORMS FILE*
2110 C[1]=0
2120 PRINT " Enter FORMS file name and press RETURN: ";
2130 LINPUT U$