home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr3.zip
/
CFBSETUP.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-01-21
|
7KB
|
214 lines
* Program CFBSETUP - Sets up all functions for running MPROFILE
Store T to LEVEL2
Erase
@ 1,1 say chname
@ 2,1 say 'DATA DISK = '+D
@ 4,23 say ' CFBUDGET Set-up Functions 5-/CFBSETUP/'
@ 8,9 say '1) Start a new ACCOUNTS file'
@ 9,9 say '2) Re-index the existing ACCOUNTS or BDIRFILE file'
@ 10,9 say '3) Names Directory - church financial/budget parameters'
@ 11,9 say '4) Printer start-up - initializes print characters'
@ 12,9 say '5) Copy a file to external format'
?
Accept ' Enter selection ' to MSEL
?
Do while @(msel,'12345Qq')=0
Accept 'Invalid entry. Please enter again ' to MSEL
enddo
Do CASE
CASE msel='1'
Store d+':ACCOUNTZ' to MFILEX
Store d+':ACCOUNTS' to MFILE
Use &MFILEX
Accept 'About to create a new ACCOUNTS file on the data disk. OK? ' to xx
If !(XX)='Y'
? 'Now copying file ACCOUNTZ to ACCOUNTS.'
Copy to &MFILE
Use &MFILE
Index on account to &MFILE
Use &MFILE index &MFILE
? 'Copying is complete.'
endif
Release MFILEX
CASE MSEL = '2'
Accept 'Enter name of file to be indexed ' to MFILE
If !(MFILE)='BDIRFILE'
Store MFILE to MFILENDX
Store 'SPACT' to MFILEKEY
else
Store d+':'+MFILE to MFILE
Accept 'Enter fields to be indexed on ' to MFILEKEY
Accept 'Enter new index file name ' to MFILENDX
endif
If file(MFILE)
Use &MFILE
? 'Now indexing file',MFILE,'by',MFILEKEY,'creating index',MFILENDX
Set talk on
Index on &MFILEKEY to &MFILENDX
Set talk off
Use
else
? 'File',MFILE,'does not exist. '
Accept 'Press <retn> ' to XX
endif
Use
CASE MSEL = '3'
Clear
Use bdirfile index bdirfile
STORE $(SPACT,4,27) TO MD1A
SKIP
STORE $(SPACT,21,1) TO MD1B
GOTO 18
If !($(spact,31,1))='N'
Store 'NO ' to MD8
else
Store 'YES' to MD8
endif
SKIP
Store $(spact,26,2) to MD3a
Store $(spact,29,2) to MD3b
SKIP
Store $(spact,27,2) to MD4a
Store $(spact,30,2) to MD4b
SKIP
Store $(spact,27,2) to MD5a
Store $(SPACT,30,2) to MD5b
SKIP
STORE $(spact,26,2) to MD6a
Store $(spact,29,2) to MD6b
GOTO 23
Store $(spact,12,18) to MD11
GOTO 25
Store $(spact,27,2) to MD12
Erase
@ 13,7 say ' ________________________________________________________________'
@ 14,7 say '| |'
@ 15,7 say '| Date __(a,b)________ |'
@ 16,7 say '| |'
@ 17,7 say '| Pay __(c,d)____long amount_____________ Amount $ __(e,f)____ |'
@ 18,7 say '| |'
@ 19,7 say '| to the order of ___(g,h)_______________ |'
@ 20,7 say '| |'
@ 21,7 say '| (address) |'
@ 22,7 say '| |'
@ 23,7 say '|________________________________________________________________|'
@ 1,10 SAY ' EDITING CHURCH BUDGET PARAMETERS'
@ 3,0 SAY 'CHURCH NAME ' GET MD1A
@ 4,0 SAY 'Disk I.D. containing data files ' GET MD1B
@ 5,0 say 'Check printing parameters -'
@ 6,4 SAY '(a,b) Row and column of check date ' get MD3a
@ 6,44 say ',' get MD3b
@ 7,4 say '(c,d) Row and column of check long amount' get MD4a
@ 7,49 say ',' get MD4b
@ 8,4 say '(e,f) Row and column of check amount' get MD5a
@ 8,44 say ' ' get MD5b
@ 9,4 say '(g,h) Row and column of check name ' get MD6a
@ 9,44 say ' ' get MD6b
@ 10,0 say 'Print long amount value on the check? ' get MD8
@ 11,0 say 'Printer, special set-up characters' get MD11
@ 11,55 say ' Press <ctrl-W> to exit.'
@ 12,0 say 'Number of print lines on a check form ' get MD12
READ
Accept ' SAVE? ' to XX
If !(XX)='Y'
GOTO 1
Replace spact with $(spact,1,3)+MD1A
skip
Replace spact with $(spact,1,20)+MD1B
GOTO 18
Replace spact with ' R Print long amount on check?'+!($(MD8,1,1))
SKIP
Replace spact with $(spact,1,25)+MD3a+','+MD3b
SKIP
Replace spact with $(spact,1,26)+MD4a+','+MD4b
SKIP
Replace spact with $(spact,1,26)+MD5a+','+MD5b
SKIP
Replace spact with $(spact,1,25)+MD6a+','+MD6b
GOTO 23
Replace spact with $(spact,1,11)+MD11
GOTO 25
Replace spact with $(spact,1,26)+MD12
endif
Use
Store T to validd1
Store '3' to MSEL
Store T to valid2
Store F to level2
CASE msel='4'
USE BDIRFILE
GOTO 23
STORE 13 TO INCHNUM
? 'Turn the printer on . . .'
STORE $(SPACT,INCHNUM,2) TO INCHAR
Set format to print
Do while inchar<>' ' .and. inchnum<30
Store val(inchar) to inchval
@ 0,inchnum say chr(inchval)
? 'ASCII ',inchar
Store inchnum+3 to inchnum
STORE $(spact,inchnum,2) to inchar
enddo
Release inchar,inchval,inchnum
Set format to screen
USE
? 'Printer is now initialized.'
CASE MSEL = '5'
Use
Select primary
Accept 'Enter file name to be copied ' to MFILE
Store d+':&MFILE' to MFILE
If .not. file(MFILE)
Accept 'File not found on data disk. Press <retn>' to MFILE
else
Accept 'Enter file index name, or <retn> for none ' to MFILENDX
If MFILENDX<>' '
Store d+':&MFILENDX'+'.NDX' to MFILENDX
If .not. file(MFILENDX)
? 'Index file',MFILENDX,'not found.'
Accept 'Press <retn> ' to MFILE
RETURN
else
Store mfile+' index '+MFILENDX to MFILE
endif
endif
USE &MFILE
Accept 'Enter selection criteria, or <retn> for none ' to MFILESEL
? 'WARNING: The new file will be erased if it already exists.'
Accept 'Enter new file name ' to MNFILE
If MFILESEL=' '
Store ' ' to XFOR
else
Store ' for' to XFOR
endif
Store d+':&MNFILE' to MNFILE
? 'Now copying',MFILE,'to',MNFILE,XFOR,MFILESEL
If MFILESEL=' '
Set talk on
Copy to &MNFILE SDF
Set talk off
else
Set talk on
Copy to &MNFILE for &MFILESEL SDF
Set talk off
endif
endif
Use
Release XFOR,MFILESEL,MNFILE,XX
CASE !(MSEL) = 'Q'
Store F to LEVEL2
RETURN
OTHERWISE
Accept 'Illegal selection. Please enter again ' to MSEL
Store F to valid2
ENDCASE
ENDDO
If LEVEL2
Accept 'Processing is complete. Press <retn> ' to XX
endif
RETURN
|'
@ 21,7 say '| (address) |'
@ 22,7 say '| |'
@ 23,7 say '|________________________________________________________________|'
@ 1,10 SAY ' EDI