home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr3.zip
/
MCONFILE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-01-21
|
5KB
|
177 lines
* Program MCONFILE - allows direct display/editing of the CONTRIB file.
? 'Select: 1) Display CONTRIB file records '
? ' 2) Edit CONTRIB records for a particular week '
Accept ' 3) Enter PLEDGED amounts for contributors ' to XX
?
Do while @(xx,'123Qq')=0
Accept 'Invalid entry. Please enter again ' to xx
enddo
Do CASE
CASE XX='2'
Select primary
Store d+':contrib' to mfile
Use &MFILE
Accept 'Enter a week number ' to ecx
Store val(ecx) to wknumb
Store $(curdates,wknumb*6-5,5) to wkname
Store (wknumb*8)+1 to FL
Store FL+9 to SS
If wknummax=15
Store 122-SS to SL
else
Store 50-SS to SL
endif
Accept 'Enter an envelope number ' to envno
Do while !(envno)<>'Q'
Erase
Store val(envno) to envnumb
@ 2,20 say 'Contribution record editing for week '+wkname
If envnumb>offermax.or.envnumb<1
Accept 'Invalid envelope number. Enter again ' to envno
Store val(envno) to envnumb
endif
Store 'R' to resp
GOTO envnumb
@ 5,20 say 'Contribution Envelope: '+envno
Store 0.00 to ocategt1
Store 0.00 to ocategt2
Store 0.00 to ocategt3
Store 0.00 to ocategt4
Store 7 to NN
Store '1' to N
Do while N<>OT
Store $(ocateg&N,FL+1,8) to resp
If resp=' '
Store 0.00 to ocategt&N
else
Store &resp to ocategt&N
endif
@ NN,22 say ocatnam&N
@ NN,35 get ocategt&N
Store NN+1 to NN
Store str(val(N)+1,1) to N
enddo
@ NN,40 say '------'
Store ocategt1+ocategt2+ocategt3+ocategt4 to EC
@ NN+1,36 say ec
READ
Store 0.00 to ocategt&OT
Store ocategt1+ocategt2+ocategt3+ocategt4 to ocategt&OT
@ NN+1,36 say ocategt&OT
?
Store '0' to N
Do while N<>OT
Store str(val(N)+1,1) to N
Replace ocateg&N with $(ocateg&N,1,FL)+str(ocategt&N,8,2)+$(ocateg&N,SS,SL)
enddo
Accept ' Enter another envelope number ("Q"=quit) ' to envno
enddo
Release SS,SL,FL,wkname,envno,ocategt1,ocategt2,ocategt3,ocategt4,ecx,envnumb,N
CASE XX='1'
Accept 'Enter "D" for Display or "P" for Print-out ' to XY
Accept 'Enter desired envelope number to start with, or press <retn> for all' ;
to xx
If !(XX)<>'Q'
Store offermax+1 to maxrec
If XX=' '
Store '1' to XX
Store ' ' to XZ
else
Store 'Y' to XZ
endif
If !(XY)='P'
?
? 'Now printing a direct CONTRIB file report. Ready the printer . . . '
Set format to print
Store 66 to curline
GOTO &XX
Do while #<maxrec .and. .not. EOF
If curline>60
Eject
@ 2,20 say 'Contributions File - - '+curdate
Store 5 to curline
endif
@ curline,0 say str(#,4)
Store '0' to N
Do while N<>OT
Store str(val(N)+1,1) to N
@ curline,5 say OCATNAM&N+OCATEG&N
Store curline+1 to curline
enddo
Store curline+1 to curline
SKIP
enddo
Set format to screen
else
erase
@ 1,10 say 'Contributions File - - '+curdate
GOTO &XX
?
Do while #<MAXREC .AND. .NOT. EOF
Store '0' to N
Do while N<>OT
Store str(val(N)+1,1) to N
? #,OCATNAM&N,OCATEG&N
enddo
SKIP
IF !(XZ)='Y'
ACCEPT 'Continue? ' to XZ
If !(XZ)<>'Y'
Store # to maxrec
endif
endif
enddo
endif
?
Accept 'Report is complete. Press <RETURN> ' to xx
endif
RELEASE XY,XZ
CASE XX='3'
Erase
@ 2,20 say 'Pledged CONTRIBUTIONS Entry Routine'
?
?
Store 'Enter pledged CONTRIBUTION amount for envelope number' to inpledgd
Accept 'Enter starting envelope number, or press <retn> for beginning ' to XX
If XX=' '
Store '1' to XX
endif
GOTO &XX
Do while #=0 and !(XX)<>'Q'
Accept 'Envelope number not found. Please enter again ' to XX
enddo
If !(XX)<>'Q'
Store ' 0.00' to oldcontr
Store ' 0' to oldenvl
Store offermax+1 to maxoffer
Do while #<maxoffer .and. !(XX)<>'Q' .and. .not. EOF
If pledged=' '
Store 0.00 to xnum
else
Store pledged to XX
Store &XX to xnum
endif
ERASE
@ 1,20 say 'PLEDGED AMOUNTS ENTRY ROUTINE'
@ 3,40 say 'Previous Envelope'+oldenvl+' $'+oldcontr
Store str(#,4) to inenvl
@ 5,5 say inpledgd+inenvl get xnum
READ
If XNUM<0
GOTO BOTTOM
else
Store str(XNUM,9,2) to XXX
Replace pledged with XXX
Store str(#,4) to oldenvl
Store XXX to oldcontr
endif
SKIP
enddo
endif
ENDCASE
0.00 to ocategt1
Store 0.00 to ocategt2
Store 0.00 to ocategt3
Store 0.00 to ocategt4
Store 7 to XX
Store '1' to