home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug073.arc
/
GENELOGY.LBR
/
LGETREC.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
3KB
|
81 lines
@ 7,0 SAY CHR(27)+'Y'
STORE ' ' TO type,more,mside,nom1,nom2
STORE t TO notfound
STORE 0 TO spacepos
STORE 1 TO mpage
STORE $(STR(0,137),1,136) TO mspc
IF xpaper = "U"
STORE 88 TO mlength
ELSE
STORE 98 TO mlength
ENDIF
DO WHILE .NOT. type$'NR'
@ 8,20 SAY "In <R>ecord or <N>ame order ? < > "
@ 8,51 GET type PICTURE "!"
READ NOUPDATE
ENDDO
CLEAR GETS
DO CASE
CASE type = 'N'
SET INDEX TO a:names
STORE 'surname-firstnms' TO mvar
DO WHILE notfound
STORE $(mspc,1,37) TO mfirst,mlast
DO WHILE mfirst > '_' .OR. mfirst < 'A' .OR. ;
mlast > '_' .OR. (mlast < 'A' .AND. mlast # ' ')
@ 12,20 SAY 'Starting SURNAME - ' GET mfirst
@ 14,20 SAY 'Ending SURNAME - ' GET mlast
READ NOUPDATE
ENDDO
CLEAR GETS
STORE TRIM(mfirst) TO mfirst
STORE TRIM(mlast) TO mlast
IF mlast =" "
STORE mfirst TO mlast
ENDIF
IF @(' ',mfirst) # 0
STORE mfirst TO nom1
STORE @(' ',mfirst) TO spacepos
STORE $(mfirst,1,spacepos-1)-$(mfirst,spacepos+1,len(mfirst));
TO mfirst
ELSE
STORE mfirst TO nom1
ENDIF
IF @(' ',mlast) # 0
STORE mlast TO nom2
STORE @(' ',mlast) TO spacepos
STORE $(mlast,1,spacepos-1)-$(mlast,spacepos+1,len(mlast));
TO mlast
ELSE
STORE mlast TO nom2
ENDIF
FIND &mfirst
IF # = 0
@ 16,30 SAY trim(mfirst)+" NOT FOUND"
@ 18,30 SAY "Press any key"
SET CONSOLE OFF
WAIT
SET CONSOLE ON
@ 12,0 SAY CHR(27)+"Y"
LOOP
ELSE
STORE f TO notfound
ENDIF
ENDDO
CASE type = 'R'
STORE 0 TO mlast
STORE ' ' TO mfirst,mlst,mvar
@ 12,11 SAY "To List ALL Records, Start with "+xinv+" 1 "+xnor+;
", End with "+xinv+xfin+" "+xnor
DO WHILE VAL(mfirst) < 1 .OR. VAL(mlst) > VAL(xfin);
.OR. mfirst > mlst
@ 14,21 SAY "Start at Record No. " GET mfirst
@ 16,21 say " End at Record No. " GET mlst
READ NOUPDATE
ENDDO
CLEAR GETS
STORE VAL(mlst) TO mlast
GO VAL(mfirst)
STORE STR(#,4) TO mvar
ENDCASE