There are many other useful classes found in the system. Only a few of them are mentioned below.
Time
represent a particular time of day.
aTime := Time now
aTime := Time hours:hours minutes:minutes seconds:seconds
aTime hour
aTime minutes
aTime seconds
Notice that Time
only represents times within a day - instances do not differenciate between
times of different dates. Use AbsoluteTime
to represent a time at a particular date.
More details are found in the
"
Time
class documentation"
and in the
"AbsoluteTime
class documentation".
aDate := Date today
aDate := Date day:day month:month year:year
aDate year
aDate month
aDate day
aDate dayOfWeek
aDate dayOfWeekName
aDate dayOfYear
aDate addDays: numDays
aDate daysUntil: anotherDate
aDate daysSince: anotherDate
More details are found in the
"
Date
class documentation".
aTimestamp := Timestamp now
aDate := aTimestamp asDate
aTime := aTimestamp asTime
Timestamp
class documentation".
aTimeduration := 50 milliseconds
aTimeduration := 5 seconds
aTimeduration := 12 minutes
aTimeduration := 3 days
aTimeduration := Timeduration hours:h minutes:m seconds:s milliseconds:ms
aTimeduration := Timeduration toRun: [ ... ]
aTimeduration + aTimeduration
aTimeduration - aTimeduration
aTimeduration * aNumber
aTimeduration / aTimeduration
aTimeduration / aNumber
Timeduration
class documentation".
Character
represent printable characters.
The character range is not limited to 8bit; 16bit and even 32 bit characters are possible
(although the windows operating system is limited to 16bit).
Characters are most often used as elements of String
and TwoByteString
;
on their own, they are seldom encountered.
Typical uses are:
codePoint
isDigit
isLetter
isUppercase
asUppercase
asLowercase
More details are found in the
"
Character
class documentation".
Point
represent a coordinate in 2D space.
They are most often used in the graphical user interface to represent window positions,
window extents, position of graphical objects etc.
aPoint := Point x:xCoordinate y:yCoordinate
aPoint := xCoordinate @ yCoordinate
xCoordinate := aPoint x
yCoordinate := aPoint y
More details are found in the
"
Point
class documentation".
Point
, instances of Rectangle
are used in the
graphical user interface. They represent a rectangular area defined by
an originPoint and a cornerPoint. (the actual internal implementation may be different).
aRectangle := Rectangle origin:originPoint corner:cornerPoint
aRectangle := Rectangle origin:originPoint extent:extentPoint
aRectangle := Rectangle x:originX y:originY width:width height:height
originPoint := aRectangle origin
cornerPoint := aRectangle corner
extentPoint := aRectangle extent
width := aRectangle width
height := aRectangle height
newRectangle := aRectangle intersect:antherRectangle
newRectangle := aRectangle scaledBy:scaleFactor
newRectangle := aRectangle translatedBy:translation
More details are found in the
"
Rectangle
class documentation".
True
and False
,
of which each has only one instance: true
and false
respectively.
Conceptionally, conditional evaluation of expressions is implemented by booleans;
however, most control structures are inline coded by the compilers for more performance.
This means, that even though you find the #ifTrue:
and
#ifFalse:
methods in these two classes,
these methods are rarely executed.
More details are found in the
"
Boolean
class documentation".
Using blocks, you can create your own control, enumeration and looping constructs.
Typical uses are:
aBoolean ifTrue:[ ... trueBlock ... ] ifFalse:[ ... falseBlock ... ]
[ ... conditionBlock ... ] whileTrue:[ ... loopedBlock ... ]
start to: stop do: [:loopVar | ... loopedBlock ... ]
aCollection do:[:element | ... block executed for each element ... ]
aButton action:[ ... block executed when button is pressed ... ]
More details are found in the
"
Block
class documentation".
OperatingSystem
offers low level access to the underlying
OS services. The actual set of implemented messages
depends on the particular OS used.
Time
, FileStream
, Filename
etc.
more to be documented
More details are found in the
"
OperatingSystem
class documentation".
Smalltalk
keeps track of all global variables on the system.
Also, it offers many functions for system management, initialization, startup and shutdown.
more to be documented
More details are found in the
"
Smalltalk
class documentation".
ObjectMemory
provides access to low level memory management functions.
There are methods to control the behavior of the garbage collector, interrupt handling etc.
more to be documented
More details are found in the
"
ObjectMemory
class documentation".
Copyright © 1996 Claus Gittinger Development & Consulting
<info@exept.de>