[Newbies] debugging by using a global variable?

Bert Freudenberg bert at freudenbergs.de
Wed Apr 20 16:26:15 UTC 2016

> On 20.04.2016, at 17:19, Joseph Alotta <joseph.alotta at gmail.com> wrote:
> Greetings,
> My code has some complex parts and I think it would be good to pull parts of it out and practice with it in a workspace window.
> For example, I have an Array of Transaction objects, that is a instance variable.  It is mostly populated from reading a file.
> What would be the best method to extract this array?
> Assign it to a global variable?

That’s one way to do it.

You can also drag that instance variable from the inspector to the workspace, which will create a variable reference.

In the latest trunk image this should work seamlessly: If you drop an Array, the workspace variable will be named something like “array12345” and be bound to that Array.

In the stable release image, you have to first enable the workspace’s “accept dropped morphs” flag from its menu button. It will create a variable named “transfer12345” and put the morph in it. You will have to refer to the Array as “transfer12345 passenger”.

- Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4207 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/3b54b54b/smime.bin

More information about the Beginners mailing list