realbasic-nug
[Top] [All Lists]

Re: String as Dictionary string

To: realbasic-nug at lists dot realsoftware dot com
Subject: Re: String as Dictionary string
From: "Theodore H.Smith" <delete at elfdata dot com>
Date: Thu, 30 Dec 2004 21:26:11 +0000
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20041230204211 dot C420D627955 at lists dot realsoftware dot com>
My ElfDataDictionary is always string based, so there's no need to go to all that effort (code below), when using my ElfDataDictionary.

From: Jason Essington <jasone at GreenRiverComputing dot com>

how hard is it to just subclass dictionary something like:

Class StringKeyDictionaryValue extends Dictionary

StringKeyDictionary.Value:
Sub Value(key As variant, assigns obj As variant)
   Dim e As IllegalCastException
   if 8 <> VarType(key) then
     e =3D new IllegalCastException
     e.Message =3D "Keys must be Strings"
     raise e
   end if
   super.Value(EncodeBase64(key)) =3D obj
End Sub

--
   Theodore H. Smith - Software Developer - www.elfdata.com/plugin/
   Industrial strength string processing code, made easy.
   (If you believe that's an oxymoron, see for yourself.)

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>