home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
MCNAMES2.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
2KB
|
72 lines
* Program MCNAMES2 - Adds an OTHER name/category to MDIRFILE
Store T to nogood
Store T to GOODCATG
? 'Enter the 3-character OTHER function code you are adding to '
Accept '(Example: "SCH" for school) ' to IC
Do while nogood
If !(IC) = 'Q'
Store F to nogood
else
If len(IC) <> 3
Accept 'Entry was not 3 characters. Enter again ' to IC
else
Store F to nogood
Store IC+': ' to INOTH
Find &INOTH
If # = 0
? 'This OTHER function category is not in the Names Directory.'
Accept 'Do you want to add it as new? ' to XY
If !(XY) = 'Y'
APPEND BLANK
Accept 'Enter name for the above function code (example: School) ' to X3
Store INOTH+$(X3,1,20) to X3
Replace spact with X3
? spact,' - ADDED'
else
Store F to goodcatg
endif
endif
endif
endif
ENDDO
If GOODCATG
Store T to morecode
Do while morecode
Store T to goodcode
Accept 'Enter a new OTHER code number ' to X2
Do case
CASE !(X2) = 'Q'
Store F to morecode
Store F to goodcode
CASE len(X2) = 1
Store '00'+X2 to X2
CASE len(X2) = 2
Store '0'+X2 to X2
CASE len(X2) = 3
Store T to goodcode
OTHERWISE
? 'Invalid entry. Three characters, maximum. '
Store F to GOODCODE
ENDCASE
If GOODCODE
Store IC+'='+X2 to INOTHX
Find &INOTHX
If # <> 0
? 'Not entered. Duplicate code number found - ',spact
else
APPEND BLANK
Accept 'Enter name for the above code (example: Roosevelt High) ' to X3
Store INOTHX+' '+$(X3,1,20) to X3
Replace spact with X3
? spact,' - NOW ADDED'
Store F to morecode
endif
endif
enddo
endif
RETURN Find &XSEL
If # = 0
APPEND BLANK
Accept 'Enter OTHER category name, up to 20 characters ' to XNAME
Store XSEL+XNAME to XNAME
Replace SPACT with X