[Pharo-project] Complete an Array

Simon De Baets debaetssimon at gmail.com
Sat Oct 23 08:50:56 EDT 2010


Hello,

I use Pharo 1.1 .  I want to add a new element in an array that have a part
of nil element. I want to add this new element on the first nil case. I
produce this code

|test isFact|

test := Array new:5.
isFact := False.
test doWithIndex:[ :each :i | ((each isNil) & (isFact = False))
    ifTrue:[
         test at:i put:'plain'; isFact := True
        ]
    ].
test.

But it doesn't function because they are two instruction in the ifTrue
bolck. So my question is : "How can i put two instructions in an ifTrue
block?"

Thanks,

-- 
Simon De Baets,
Etudiant en MA1 informatique à l'ULB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101023/ddc1e0d1/attachment-0001.html>


More information about the Pharo-dev mailing list