home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr2.zip
/
CSELCHNG.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
5KB
|
150 lines
* Program CSELCHNG - Changes or Deletes lodging Room/Bed assignments.
* Called by CSELODGE from selecting 3-C or 3-D CSEVENTS
* By Rod Williams; WaterWares, March, 1985.
Store xsel+' ' to xsel
Store $(xsel,2,5) to inbed
If inbed=' '
Accept 'Enter a Room/Bed assignment ' to inbed
Store inbed+' ' to inbed
Store $(inbed,1,5) to inbed
endif
If !(inbed)<>'Q ' .and.inbed<>' '
Select secondary
Store sfield+inbed to infind
Find &infind
If #=0
? 'Room/Bed is not found.'
else
Store $(spact,15,11) to nfind
Store trim($(spact,27,10)) to ffind
Store str(#,5) to oldrec
Select primary
Store F to nfound
If NFIND<>' '
Find &NFIND
If #<>0
Do while last:name=nfind .and. first:name<>ffind.and. .not. EOF
SKIP
enddo
If last:name=nfind.and. first:name=ffind
Store T to nfound
endif
endif
endif
If nfound
Store nfind+' '+ffind to nfind
Store 'for '+nfind to nnfind
else
Store ' ' to nnfind
endif
If !(xsel)='D'
? 'Now deleting -',nfind,' ... ',$(S.spact,1,14)
If nfound
Replace room with ' '
endif
Select secondary
Replace spact with infind
Accept 'Do you want to delete the Room/Bed code too? ' to xx
If !(xx)='Y'
? 'NOW DELETED - ',spact
Replace spact with $(spact,1,8)+'.'
DELETE
Store II-1 to II
endif
else
If nfound
Store F to chold
If ROOM=$(infind,6,9) .or.ROOM=' '
Store T to chold
else
? 'The Room/Bed assignment in MEMBERSE does not match for this person.'
Store sfield+$(room,5,5) to xx
Select secondary
Find &XX
If #<>0
? 'The Name is cleared in the EDIRFILE. '
GOTO &oldrec
Replace spact with $(spact,1,14)
else
? "This person's Room/Bed is being re-assigned."
Store T to CHOLD
endif
endif
If CHOLD
Accept 'Enter a new Room/Bed assignment ' to inbed
Store inbed+' ' to inbed
If !(inbed)<>'Q ' .and. inbed<>' '
Store sfield+$(inbed,1,5) to xx
Store T to RBCHANGE
Store F to RBAPPEND
Store sfield to sfieldx
Select secondary
If len(trim(inbed)) > 5
Store 'ROOM='+$(inbed,1,3)+' ' to xx
Find &xx
If #=0
? 'This different LODGING name, "',$(inbed,1,3),'" not found. No change made.'
Store F to RBCHANGE
else
Store xx to sfieldx
Store $(inbed,5,5) to inbed
Store sfieldx+inbed to xx
Find &xx
endif
else
Store $(inbed,1,5) to inbed
Find &xx
endif
If RBCHANGE
If #<>0
If $(spact,15,10)<>' '
? 'This Room/Bed is already assigned. No change is made.'
Store F to RBCHANGE
else
Store str(#,5) to newrec
endif
else
Store T to RBappend
endif
endif
If RBCHANGE
? 'Now replacing',infind,'with',sfieldx,inbed,nnfind
Select primary
Replace room with $(sfieldx,6,4)+inbed
Select secondary
GOTO &oldrec
Replace spact with $(spact,1,14)
If RBAPPEND
Append blank
If $(sfieldx,6,4)=$(sfield,6,4)
Store II+1 to II
endif
else
GOTO &newrec
endif
Replace spact with sfieldx+inbed+nfind
endif * RBCHANGE
endif
endif
else
Set raw on
? 'Name "',nfind,ffind,'" is not found in MEMBERSE. Now cleared from EDIRFILE.'
Set raw off
Select secondary
GOTO &OLDREC
Replace spact with $(spact,1,14)
endif
endif
endif * #=0
endif
Store 'C' to xsel
RETURN
l
RETURN
to inbed
endif
If !(inbed)<>'Q ' .and.inbed<>' '
Select secondary
Store sf