HP 2624 Manual page 55

Display terminals
Table of Contents

Advertisement

Designing and Using Forms
Figure 5-7 shows the source listing of a BASIC/3000 pro-
gram that reads a completed form structure from the ter-
minal's screen and generates the PRINT statements nec-
essary to recreate the form on the screen. FORMIO was
designed primarily to assist with the programming of com-
plex data entry forms which are much easier to create
using the
"define fields", "define edits", "enhance
video",
and
"modify char .set"
function keys than to ac- (
tually code in PRINT statements. You may, however, use it
with any type of data (straight alphanumeric text, math
symbols, line drawing set elements, and the large char-
acter set).
5-10
FORM-IO
10 FILES .,.
20 SYSTEM Xl,"aUILD FDATA;rec--132"f,sscii"
30 SYSTEM Xl,"FILE X-$stdln;rec--2S6"
40 ASSIGN "FDATA",l,Al
50 ASSIGN "X",2,Al,WR
60 DIM A$[2551,Al$(61,C$[31
70 PRINT CTL(208),'27"F"'27"s";
80 ENTER 255,X,A$
90 CONVERT AI[8;3J TO R
100 PRINT "This pr09ram creates basic statements that define the"
110 PRINT "FORM
or
other data in this term1nal's memory.";LIH(3)
120 INPUT "Startin9 ststement number, increment
?",A,B
130 PRINT CTL(208),'27"&f2a8k2L"'27";"'27"&f8E";
140 LlNPUT AS
150 PRINT '27"h";
160 PRINT #l;"ser";END
170 1i0R 1-1 TO R
180
PRINT '27"d";
190
LINPUT #2;AS
200
IF UPS$(A$[l,31)-"RUN- THEN 500
210
IF UPSS(AS[l,41)-">RUN" THEN 500
220
CONVERT A TO Al.
230
REM compensate for imbedded
marks
240
C--4
250
IF C+5)LEN(AS) THEN 310
260
Cl-POS(A$[C+51,'34)
270
IF NOT Cl THEN 310
280
C-Cl+C+4
290
AS- A-S [ 1 , C I +" , 34" + ' 34 + A S [ C + 1 I
300
GOTO 250
3tQ
REM
5pace~
)-7 are converted to direct Cursor addresses
320
FOR C-
t
TO LEH(AS>
330
IF AS[C,C.61-"
" THEN DO
340
FOR Cl-C+7 TO LENCA.)
350
IF A$[Cl.Cl1c)" " OR LENCAS)-Cl THEN DO
360
CONVERT Cl-C TO CS
370
AS [ C I - ' 2]," &a .. " .. D E a S C C $) • "C II • AS
r
C 11
380
GOTO 310
390
DOEND
400
NEXT Cl
410
DO END
42Q
NEXT C
43.0
REM output form record a.s a BASIC print statement
440
PRINT #1;" ".A1$+"' print ctl(20S),&";END
450
PRINT #1; '34.AS[ l,LEN·CAS) MIN 1271
j
u"";END
460
IF LEN1A$)<t28 THEN PRINT 11;'34;END
470
IF LENCAI»·128 THEN PRINT 11;A$[1281.'34;END
480
A-A.a
490 NEXT I
500 PRINT '27"FNow type 'XEQ FDATA' then 'LIST'.";LIN(1)
510 PRINT "ThElse statements will reproduce your terminal's me·mory-.-"
520 PRINT IImodHy, NAME, RENUM, and SAVE as you wis.h ...... "
530· PRI NT CTL(208),' 27'" f2a8k 3L" "27":"
t
13' 27"& f8E";
540. LINPUT A$
550 END
Figure 5-7. FORMIO Source Listing
(
(

Advertisement

Table of Contents
loading

Table of Contents