Ripley Beginner
Joined: 30 Mar 2005 Posts: 15 Topics: 8
|
Posted: Sun Apr 30, 2006 9:26 pm Post subject: A good Rexx sample to create key-value data structure |
|
|
Code: |
/* CODE LOOKUP: */
/* */
/* Looks up the areacode for the town the user enters. */
area. = '' /* pre-initialize all entries to the null string */
area.Chicago = 312 ; area.Wrigleyville = 773
area.Homewood = 708 ; area.Geneva = 630
area.Zion = 847 ; area.Schaumburg = 847
do while town <> ''
say 'For which town do you want the area code?'
pull town .
if town <> '' then do
if area.town = ''
then say 'Town' town 'is not in my database'
else say 'The area code for' town 'is' area.town
end
end
|
i read from the book
http://www.amazon.com/gp/product/0764579967/sr=1-1/qid=1146449456/ref=sr_1_1/104-7996049-5490334?%5Fencoding=UTF8&s=books
|
|