Help with hash table syntax
From
hank.lenzi@gmail.com@21:1/5 to
All on Fri Jan 28 16:37:07 2022
Hello, eiffelers --
I'm getting a syntax error at line 48 (I've flagged it with a comment), but I can't wrap my head around it. What's wrong?
note
description: "Summary description for {MONTH_OFFSET}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
MONTH_OFFSET
create
start
feature
start
note
goals: "[ Calculate the month offset ]"
local
month_offset_table: HASH_TABLE[INTEGER, STRING] -- in Eiffel, it's: [Value,Key]
do
create month_offset_table.make(12)
month_offset_table.put (6, "jan")
month_offset_table.put (2, "feb")
month_offset_table.put (2, "mar")
month_offset_table.put (5, "apr")
month_offset_table.put (0, "may")
month_offset_table.put (3, "jun")
month_offset_table.put (5, "jul")
month_offset_table.put (1, "aug")
month_offset_table.put (4, "sep")
month_offset_table.put (6, "oct")
month_offset_table.put (2, "nov")
month_offset_table.put (4, "dec")
-- exhibit
across month_offset_table as ic loop
print (ic.cursor_index.out + ": ")
print (ic.item.out + ", ")
print (ic.key.out + "%N")
end -- loop
-- feature
-- h.put (v, k)
-- v := h.item (k) -- given k key (STRING type) it returns v value (INTEGER type)
feature {NONE}
fetch_value(key: STRING): INTEGER -- SYNTAX ERROR SIGNALED HERE
-- access query (takes a STRING, returns an INTEGER)
local
value: INTEGER
do
value := month_offset_table.item(key)
Return := value
end
end
end -- class MONTH_OFFSET
Thanks for any help.
-- Hank
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)