[Newbies] Perform

Frank Urbach frank.urbach at schmees.com
Mon Jan 14 14:23:10 UTC 2008


Hi Jakub,

if I correctly understand your question the following will do what you want:

test := MyTest new. 

myString:= ('phone1' , ':' asString) asSymbol.

test perform: myString with: 'tesValue'.

The above you can use in a Workspace.

The essential from this is: Object perform: with: 

MyTest contains:

MyTest>>phone1: aValue
  phone1 := aValue.

MyTest>>phone2: aValue
  phone2 := aValue.

HTH

  Frank


>hello i have class with two setters
>phone1: aValue
>phone2: aValue
>
>and i want call it dynamically
>aSelector is phone1 or phone2 string
>
>setPhohne: aSelector by: aValue
>
>phoneBook perform aSelector, ':' aValue 
>
>but this is not working how can i do this when i try this iwth getters it works fine
>
>Transcript show: (phoneBook perform aSelector); cr.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20080114/aebd95a1/attachment.htm


More information about the Beginners mailing list