Printing an array on file without quotes

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

Printing an array on file without quotes

oscar
Hi all,

I'm trying to print arrays using:

FileStream forceNewFileNamed: 'path/file' do: [ :stream |
        ...
        stream print: myArray asCommaString withoutQuoting .
        ... ]

The printing works well, but in the file, I get something like this:

'numbers, 1 , 2 , 3 , 4'

with quotes!. This is a little annoying, because I'm forced to manually remove the quotes. Is there a way to get the printed file without quoting?

Sorry for my n00b question .


Thanks in advance.

P.S.: Pharo image 1.1.1

 Oscar E. A. Callaú
Reply | Threaded
Open this post in threaded view
|

Re: Printing an array on file without quotes

oscar
Hi all again,

actually it was a very n00b question and the answer is simple:

Use #nextputAll: instead of #print

Greetings

On Nov 25, 2010, at 11:37 , Oscar E A Callau wrote:

> Hi all,
>
> I'm trying to print arrays using:
>
> FileStream forceNewFileNamed: 'path/file' do: [ :stream |
> ...
> stream print: myArray asCommaString withoutQuoting .
> ... ]
>
> The printing works well, but in the file, I get something like this:
>
> 'numbers, 1 , 2 , 3 , 4'
>
> with quotes!. This is a little annoying, because I'm forced to manually remove the quotes. Is there a way to get the printed file without quoting?
>
> Sorry for my n00b question .
>
>
> Thanks in advance.
>
> P.S.: Pharo image 1.1.1
>
> Oscar E. A. Callaú


Reply | Threaded
Open this post in threaded view
|

Re: Printing an array on file without quotes

Stéphane Ducasse
In reply to this post by oscar
Oscar

There are only a few really really newbies questions.
Then we like newbies and their questions because we learned all a lot from them.
So this is not because we may talk about stuff that looks complex that
        - they are (often this is just that we do not have enough time to understand)
        - we know everything
        - we do not like to reply to simple questions
        - we do not like to learn from answer to simple questions.
So keep asking questions and having fun with us.
I hate those mailing-lists where people are asked to do their homework. :)

Stef