[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
eXept User Forum • View topic - Adding a method to class
Questions about smalltalk/x and its class library

Adding a method to class

Postby smalltalker89 » 3. Jan 2010, 06:26

hello,

how can i add a simple method to a simple class in smalltalk x
by using just code without browser .

for example:
why this is not good?

(i tried to do it by the tutorial of smalltalk x.. )

Object subclass: #Tokenizer
instanceVariableNames: 'name'
classVariableNames: ''
poolDictionaries: ''
category: 'MakingSmalltalk-Article2'

Tokenizer>>setName:newName
name:= newName

|t|
t:=Tokenizer new.
t setName:'Miller'.

it doesn't know the method
i want it to connect setName with the class Tokenizer

thanks
smalltalker89
 
Posts: 3
Joined: 27. Nov 2009, 14:17

Re: Adding a method to class

Postby jan_vrany » 3. Jan 2010, 11:12

jan_vrany
 
Posts: 28
Joined: 10. Dec 2008, 12:37


Return to Programming Help

Users browsing this forum: No registered users and 1 guest

Design by GB