Help needed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Help needed

Raymond Asselin-4
I get an app that I made in Squeak. I would like to print the content of some OrderedCollection but don't know how to do that.
I thought to us a FileStream but never worked with Stream before any clue or reference is welcome.
My objectif is to print a list of my orderedCollection. I want a hard copy...

Raymond Asselin_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help needed

Mateusz Grotek
Dnia 27.03.2015 15:57:51, Raymond Asselin napisał(a):
> I get an app that I made in Squeak. I would like to print the content  
> of some OrderedCollection but don't know how to do that.
> I thought to us a FileStream but never worked with Stream before any  
> clue or reference is welcome.
> My objectif is to print a list of my orderedCollection. I want a hard  
> copy...
>

It depends on what you mean by printing. Normally you print to  
Transcript. Just open the Transcript window from the Tools menu and do:
Transcript showln: collection.

Does it solve your problem?



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help needed

Herbert König
In reply to this post by Raymond Asselin-4
Hi Raymond,

the easy part is:
|file|
file := StandardFileStream forceNewFileNamed: 'yourFilename'.
file nextPutAll: 'your collections contents as a String'
file close.

The hard part is how to print your collection (and if necessary its
elements) as a string.
You add to the stream with file nextPut: for single charcters or
nextPutAll: for Strings.

You'd need to give some details about your collection for more help.

Cheers,

Herbert



Am 27.03.2015 um 15:57 schrieb Raymond Asselin:
> I get an app that I made in Squeak. I would like to print the content of some OrderedCollection but don't know how to do that.
> I thought to us a FileStream but never worked with Stream before any clue or reference is welcome.
> My objectif is to print a list of my orderedCollection. I want a hard copy...
>
> Raymond Asselin_______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help needed

Kirk Fraser
In reply to this post by Raymond Asselin-4
A common way is to write your own print method, so it will print as you want it anywhere, whether you send it to the Transcript or as a result in a work space.  Example:

printOn: aStream
aStream nextPutAll: 'My result = ', result printString, ' data = ', data variable.



Kirk W. Fraser
www.JesusGospelChurch.com - Replace the fraud churches with the true church.
http://freetom.info - Example of False Justice common in America

On Fri, Mar 27, 2015 at 7:57 AM, Raymond Asselin <[hidden email]> wrote:
I get an app that I made in Squeak. I would like to print the content of some OrderedCollection but don't know how to do that.
I thought to us a FileStream but never worked with Stream before any clue or reference is welcome.
My objectif is to print a list of my orderedCollection. I want a hard copy...

Raymond Asselin_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help needed

Raymond Asselin-4
This is a Maui UI

Herbert König said: "You'd need to give some details about your collection for more help." So it is:

When i select 'fileOutMedicaments' , I want to produce a text file that I can print with a printer. And the content would be the 'sortedMedicaments' list. I don't want to print to Transcript. It is easy to export in graphic format but I want a text file…At least something I can open in a text editor an say "Print"…to get hard copy.

So the content is : #date, #temps, #nom, #commentaire. 


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help needed

Mateusz Grotek
> At least something I can open in a text editor an say "Print"…to get  
> hard copy.

You have three options:
1. To create a normal text file (.txt)
2. To create a PostScript file (.ps)
3. To create an image (.jpg or .png)

Please choose one. :-)

P.S.
PostScript files can be printed directly in Linux. In Windows it  
depends on your printer. If it supports PostScript you can send it  
directly, if not you need some software, like GhostScript.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Help needed

Raymond Asselin-4
Thanks to everybody, with your hints I came with a solution which satisfies me.

It's done now
Again thanks

> Le 2015-03-27 à 12:48, Mateusz Grotek <[hidden email]> a écrit :
>
>> At least something I can open in a text editor an say "Print"…to get hard copy.
>
> You have three options:
> 1. To create a normal text file (.txt)
> 2. To create a PostScript file (.ps)
> 3. To create an image (.jpg or .png)
>
> Please choose one. :-)
>
> P.S.
> PostScript files can be printed directly in Linux. In Windows it depends on your printer. If it supports PostScript you can send it directly, if not you need some software, like GhostScript.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners