On 7 January 2013 13:01, Sean P. DeNigris <sean@clipperadams.com> wrote:
Frank Church wrote
> I want to create a collection of Workspace contents...What kind of array
> would best suited to the task?

I usually just start with an OrderedCollection until I feel the need for
something more complicated. It's like an Array, but will grow dynamically.

Two things to check out that already exist in the system:
* you can save workspace contents to a file by clicking the little arrow in
the top right of the workspace window and select "Save As..."
* check out ScriptManager, which is a GUI for organizing and saving
workspaces. It was included in Pharo by default in 1.3 (I think) and has a
repo on sqs... search the list to see how/if it can be loaded into later
Pharos.



I tried ScriptManager but it appears to save the files in a binary format. It wouldn't open in a text editor .

I am interested in something which persists in Smalltalk, so I can just browse them without saving to disk, 'The Smalltalk Way'. Saving to disk is an option though.

Is there a way of selecting a workspace and extracting the text it contains. Something like a small script to enumerate all open Workspaces and printing out their text contents in a Transcript?

I saw your blog article about using Smalltalk to view the contents of your mailbox and the other about parsing a feeds contents and I want to try something similar as a
start.

My thoughts are along these lines.

1. Define a class consisting of workspace and a method which returns their text content.
2. Define collection
3. List workspaces and add to collection. I am not sure if this will replicate the workspaces perhaps they should be 'pointers' to the workspaces
4. inspect/explore the results like you did in your blog.

Thanks

HTH,
Sean



--
View this message in context: http://forum.world.st/How-do-I-save-contents-of-Workspace-into-a-collection-tp4662321p4662327.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--
Frank Church

=======================
http://devblog.brahmancreations.com