Hi Simon,
If I understand well, you should use a dot to separate the two expressions
in the block.
|test isFact|
test := Array new:5.
isFact := False.
test doWithIndex:[ :each :i | ((each isNil) & (isFact = False))
ifTrue:[
test at:i put:'plain'.
isFact := True
]
].
#Luc
2010/10/23 Simon De Baets <[email protected]>
> 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
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project