home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug073.arc
/
GENELOGY.LBR
/
LPLACE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
3KB
|
120 lines
* LPLACE.CMD Called by L.CMD for list indexed by Name or Recd. No.
* with dates and places of Birth, Death and Marriage and Spouses.
DO lgetrec
STORE $(STR(0,137),1,136) TO mspc
STORE ' ' TO mspouse1,mspouse2
STORE 0 TO mlines
STORE 1 TO mpage
IF myprnt = "P"
@ 6,0 SAY CHR(27)+'Y'
@ 6,30 SAY "Turn Printer ON"
SET PRINT ON
?? " "
?? CHR(27)+"Q"+CHR(27)+"B"
@ 6,0
ENDIF
STORE ' ' TO order
DO CASE
CASE type = 'N'
IF nom1 # nom2
STORE nom1+" to "+nom2 TO order
ELSE
STORE nom1+"s" TO order
ENDIF
CASE type = 'R'
STORE 'Records '+TRIM(mfirst)+' to '+TRIM(mlst) TO order
ENDCASE
ERASE
? "Printed "+date()+$(mspc,1,106)+"Page "+STR(mpage,2)
?
? order
?
? "RECD NAME"+$(mspc,1,28)+"BORN"+$(mspc,1,28)+"DIED"+;
$(mspc,1,28)+"MARRIED"
?
STORE mlines+6 TO mlines
DO WHILE &mvar <= mlast .AND. .NOT. EOF
STORE STR(#,4) TO temp
STORE TRIM(surname)+' '+firstnms TO mnom
? STR(#,4)+' '+$(mnom,1,30)
IF borndate > ' ' .OR. dieddate > ' '
?? ' '+borndate+$(mspc,1,21)+dieddate
ENDIF
STORE mlines+1 TO mlines
DO CASE
CASE spouse1 = 0
IF bornat > ' ' .OR. diedat > ' '
? $(mspc,1,37)+bornat+' '+diedat
STORE mlines+1 TO mlines
ENDIF
CASE spouse1 > 0 .AND. spouse2 = 0
?? $(mspc,1,20)+weddate
IF bornat > ' ' .OR. diedat > ' ' .OR. wedat > ' '
? $(mspc,1,37)+bornat+' '+diedat+' '+wedat
STORE mlines+1 TO mlines
ENDIF
GO spouse1
STORE TRIM(surname)+' '+firstnms TO mspouse1
? $(mspc,1,101)+$(mspouse1,1,30)
STORE mlines+1 TO mlines
GO &temp
CASE spouse1 > 0 .AND. spouse2 > 0
GO spouse1
STORE TRIM(surname)+' '+firstnms TO mspouse1
?? $(mspc,1,20)+'1. '+weddate
IF wedat > ' '
? $(mspc,1,101)+wedat
STORE mlines+1 TO mlines
ENDIF
? $(mspc,1,101)+$(mspouse1,1,30)
STORE mlines+1 TO mlines
GO &temp
GO spouse2
STORE TRIM(surname)+' '+firstnms TO mspouse2
? $(mspc,1,101)+'2. '+weddate
STORE mlines+1 TO mlines
IF wedat > ' '
? $(mspc,1,101)+wedat
STORE mlines+1 TO mlines
ENDIF
? $(mspc,1,101)+$(mspouse2,1,30)
STORE mlines+1 TO mlines
GO &temp
ENDCASE
?
STORE mlines+1 TO mlines
SKIP
IF type = 'R'
STORE STR(#,4) TO mvar
ENDIF
IF myprnt = 'P'
IF mlines+10 > mlength
SET CONSOLE OFF
DO WHILE mlength-mlines > 0
?
STORE mlines+1 TO mlines
ENDDO
STORE mpage+1 TO mpage
? "Printed "+date()+$(mspc,1,106)+"Page "+STR(mpage,2)
?
? "RECD NAME"+$(mspc,1,28)+"BORN"+$(mspc,1,28)+"DIED"+;
$(mspc,1,28)+"MARRIED"
?
STORE 4 TO mlines
SET CONSOLE ON
ENDIF
ENDIF
ENDDO
IF myprnt ='P'
? CHR(27)+'N'+CHR(27)+'A'
SET PRINT OFF
ENDIF
?
? ' Press <RETURN> when ready'
SET CONSOLE OFF
WAIT
SET CONSOLE ON
SET INDEX TO
ERASE
RETURN