Novice questions: Smalltalk 3.0 for DOS 
Author Message
 Novice questions: Smalltalk 3.0 for DOS

I'm just learning Smalltalk on my own & I've just run into some slight
difficulties that I would appreciate any help on:

1)      I currently have an Array object containing Number objects.
 How can I output the Numbers to the System Transcript when the Transcript's
methods will only deal with String objects?

2)      I'm trying to create a method to draw a circle using the class
Pen.  Is there an existing Pen method that aids in drawing circles?

The object oriented environment is still very confusing to me.  All
help is greatly appreciated.

========================================================================
Kevin Chen              
Vancouver, British Columbia, Canada



Sun, 27 Jul 1997 10:00:33 GMT  
 Novice questions: Smalltalk 3.0 for DOS


for Kevin Chen:
1)      I currently have an Array object containing Number objects.
 How can I output the Numbers to the System Transcript when the Transcript's
methods will only deal with String objects?

2)      I'm trying to create a method to draw a circle using the class
Pen.  Is there an existing Pen method that aids in drawing circles?

The object oriented environment is still very confusing to me.  All
help is greatly appreciated.

 1.) a solution to show an Array on Transcript
 | aArray |
     "make an array anf fill it with numbers"
  aArray := Array new: 10.
  1 to: aArray size do: [:number|
         aArray at: number put: number].
  Transcript cr. "Carriage-Return for next line"
      "loop over all elements of the array"
  aArray do: [:element|
         "show one number on the screen"
      Transcript show: element printString.
             "printString is in Object,
              available for each Object
              to make a string from it"
      Transcript cr. "Carriage-Return for next line"
                                ].

 1.) a solution to show an circle

    Their is a method named   ellipse: aspect:   in class Pen,
    you can use it. To test it mark it and use -doIt- from the text-editor:

          Turtle home ; black ; width: 4 ; ellipse: 100 aspect: 1 .
          Turtle ellipse: 100 aspect: 2 .

   Turtle is a globalvariable, defined in the original Smalltalk-System,
   used by the demo-programm. For more pen-functions use the
   ClassHierarchieBrowser and look under pen-instance-methods,
   you can see what the pen can.
    Their are more examples in the file chapter.2 ,
    this is are the tutorial-files.

To learn the syntax of Smalltalk is easy, but you can program
somthing, if you know enough about the whole system, because
it is not the sytax, what make Smalltalk, it is the Class-Hierarchy,
you can look in with the Browser. So it is very complicated to
programm a short programm, and it takes long to know enough about
the Classes in the system.
  The problem is to get those methods, you want, you must search
it , test it, if is the right.
 If you have further questions, you can contact me on

                             good work
                                        Markus STAMPFL
--



Sun, 03 Aug 1997 17:39:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Smalltalk/V DOS 3.0 Multiprocessing & DOS calls

2. Smalltalk/V DOS 3.0

3. Novice Smalltalk question about File class

4. novice question about Smalltalk books

5. VA 3.0/Smalltalk - two Beginners question

6. newbie questions about VisualAge SmallTalk 3.0, help!

7. Upgradation from SmallTalk 3.0 to SmallTalk 6.0

8. Regarding font problems in SmallTalk 3.0 to SmallTalk 6.0 Upgrade

9. Novice RETRACT question (now SETOF/BAGOF question)

10. Questions About Smalltalk V/DOS

11. Smalltalk V/DOS Question: Delete Instance Variable

12. Smalltalk V/DOS Questions: Renaming Classes

 

 
Powered by phpBB® Forum Software