this is an excerpt:
Code: Select all
EnumBox = {storage = {}}
EnumEntry = {key ="",msgid="",value=""}
Function EnumEntry:Create(key,msgid,value)
t = CopyTable(self)
t.key = key
t.msgid = msgid
t.value = value
EnumBox:Add(t)
EndFunction
Function EnumBox:Add(entry)
;check if already exists
Local ret = EnumBox:CheckExist(entry)
If(ret = 0)
InsertItem(self.storage, entry)
EndIf()
EndFunction
Function EnumBox:CheckExist(entry)
Local a, b = NextItem(EnumBox.storage)
While GetType(a) <> #NIL
;DebugPrint(b.key.."--"..b.msgid.."--"..b.value)
If(entry.key = b.key and entry.msgid = b.msgid and entry.value = b.value)
Return(1)
EndIf()
a, b = NextItem(EnumBox.storage, a)
Wend
Return(0)
EndFunction
Can the statement
Code: Select all
t = CopyTable(self)