[Newbies] perform withArguments

Randal L. Schwartz merlyn at stonehenge.com
Tue Apr 24 14:07:56 UTC 2012


>>>>> "Dawson" == Dawson  <abu_joseph at yahoo.com> writes:

Dawson> 		   (cellNumber =1) ifTrue: [cell1 cellLock:aBoolean].
Dawson> 		   (cellNumber =2) ifTrue: [cell2 cellLock:aBoolean].
Dawson> 		   (cellNumber =3) ifTrue: [cell3 cellLock:aBoolean].
Dawson> 		   (cellNumber =4) ifTrue: [cell4 cellLock:aBoolean].
Dawson> 		   (cellNumber =5) ifTrue: [cell5 cellLock:aBoolean].
Dawson> 		   (cellNumber =6) ifTrue: [cell6 cellLock:aBoolean].
Dawson> 		   (cellNumber =7) ifTrue: [cell7 cellLock:aBoolean].
Dawson> 		   (cellNumber =8) ifTrue: [cell8 cellLock:aBoolean].
Dawson> 		   (cellNumber =9) ifTrue: [cell9
Dawson> 		   cellLock:aBoolean].

The problem is upstream of this.  Why do you have variables named like
"cell1" through "cell9"?  At that point, your design went awry.  Back up
to there, and put those values into an array, and things will clear up.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion


More information about the Beginners mailing list