[etoys-dev] If I create a text string which contains squeak code, how can I execute it from within a script?

Steve Thomas sthomas1 at gosargon.com
Wed Feb 1 16:24:12 EST 2012


I am trying to create a project where kids can enter their own "Connector"

So what I want to do is given a connector connected to two text boxes (one
Enhanced Text, so I can execute a script when they hit <CR> or on <focus
I have a string variable defined for the connector, in which the kids can
enter a function like ( D = S + 25)
Where D maps to DestinationPlayer and S maps to SourcePlayer.

Ideally I would like to generate the below script and execute it:

self getDestinationPlayer setNumericValue: self getSourcePlayer
getNumericValue + 25

Need some squeak coding help on this.  I guess specifically, assuming I can
figure out how to create a string with the correct code ...
How do I "do it" to the string?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/etoys-dev/attachments/20120201/47fedef3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ConnectorMath.001.pr
Type: application/octet-stream
Size: 94649 bytes
Desc: not available
URL: <http://lists.squeakland.org/pipermail/etoys-dev/attachments/20120201/47fedef3/attachment-0001.obj>

More information about the etoys-dev mailing list