OpenAmiga (732/964)

From:Patrick Roberts
Date:21 Sep 2000 at 09:53:13
Subject:Re: AMIOPEN: Hotkey Config/Need suggestions

This sounds simpler, faster, and more effecient than reading a config
file and applying formatted strings to an array based on a checksum
criteria to you? How did you get your middle name, man! *Argh*

-Pat

Aaron Optimizer Digulla wrote:
>
> *Argh* Use hashes, man ! That's what they are for !! Check the Ami docs for
> hash and atoms.
>
> To explain: An atom maps a string to an integer. And a hash is a dictionary
> where you can efficiently store values under keys and look them up later with
> these keys. The code will look like this:
>
> - Create a hash
> - Register all config strings as atoms
> - Use the IDs of the atoms to put the default values in the hash
> - Read the config. Lookup the ids of the items and put them into
> the hash.
> - Later in the code, query the hash for the config items by using
> the ids.
>
> Simple, fast, efficient and most of the work has already been done by
> Ami.
>
> --
> ==============================================
> Sowatec AG, CH-8330 Pf�ffikon (ZH)
> Witzbergstr. 7, http://www.sowatec.com
> Tel: +41-(0)1-952 55 55
> Fax: +41-(0)1-952 55 66
> ----------------------------------------------
> Aaron "Optimizer" Digulla, digulla@sowatec.com
> ==============================================
> Subscribe/Unsubscribe: open-request@amiga.com
> Amiga FAQ: http://www.amiga.com/faq.html
Subscribe/Unsubscribe: open-request@amiga.com
Amiga FAQ: http://www.amiga.com/faq.html