[plt-scheme] Re: Text-contents to a function variable

From: Thomas Chust (chust at web.de)
Date: Thu Jan 14 13:00:40 EST 2010

Avi wrote:
> Goal: To balance a chemical compound
>  I have GUI that when a user enters 2 elements in seperate text boxes,
> the element charges are plugged into a function that processes every
> combination of the charge multiplied by 1 2 and 3
> So, I understand the hash table concept, but once I have the table set
> up how would I use that in my function?
> [...]

Hello Avi,

when the user has entered values into the text boxes...

(1) ... get the entered string,
(2) use hash-ref to translate the strings into the numerical charges,
(3) iterate through the multiplication factors in two nested loops,
    multiplying the charges with the factors and doing whatever else
    needs to be done ;-)

I really don't see where the problem is :-(


When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.