Re: [Pharo-users] how to convert this with a stream

2019-03-27 Thread Roelof Wobben
@Richard , thanks a lot I was already using that way and finnaly I solved it here is my code :  https://github.com/RoelofWobben/Tournament- Someone who can give feedback to the way I solved it Roelof Op

Re: [Pharo-users] how to convert this with a stream

2019-03-27 Thread Richard O'Keefe
"I have a SortedCollection of Teams. Now I need to convert *it* to a line like ...". Well, no. You need to convert *each team* separately to such a line. So something like aStream nextPutAll: '...header line...'; cr. mySortedTeams do: [:eachTeam | -write a formatted line describing eac

Re: [Pharo-users] how to convert this with a stream

2019-03-26 Thread Roelof Wobben
Carlo, Thanks, This gives the output I expect outcome         add: 'Team   | MP |  W |  D |  L |  P'.     outcome         add:             (String                 streamContents: [ :s |                     TeamStatusSorted                         do: [ :each |           

Re: [Pharo-users] how to convert this with a stream

2019-03-26 Thread Carlo
Hi Roelof The block [] should be (). What's happening is that the block is being added to outcome which will then print itself out. Cheers Carlo On 26 Mar 2019, at 20:45, Roelof Wobben wrote: Hello Could be , im confused now I tried this : outcome add: 'Team

Re: [Pharo-users] how to convert this with a stream

2019-03-26 Thread Roelof Wobben
Hello Could be , im confused now I tried this : outcome         add: 'Team   | MP |  W |  D |  L |  P'.     outcome         add: [ String                 streamContents: [ :s |                     TeamStatusSorted                         do: [ :each |                    

Re: [Pharo-users] how to convert this with a stream

2019-03-26 Thread Carlo
Hi Roelof I think you meant String streamContents: and not Array streamContents: On 26 Mar 2019, at 20:12, Roelof Wobben wrote: Hello, I have a SortedCollection of teams. Now I need to convert this to a line like this : 'Allegoric Alaskans | 1 | 1 | 0 | 0 | 3' I tr

[Pharo-users] how to convert this with a stream

2019-03-26 Thread Roelof Wobben
Hello, I have a SortedCollection of teams. Now I need to convert this to a line like this : 'Allegoric Alaskans |  1 |  1 |  0 |  0 |  3' I tried it with this : outcome := Array         streamContents: [ :s |             TeamStatusSorted                 do: [ :each |