From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:46:07 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>Customer1Example</name> <environment>Examples</environment> <super>Core.Object</super> <private>false</private> none accountID name address phoneNumber <imports></imports> <category>Examples-Help</category> <attributes> <package>Cust1-Example</package> </attributes> </class> <comment> Examples.Customer1Example
This example class is used as a data structure.
</comment> <methods> Examples.Customer1Example <category>accessing</category>
accountID ^accountID
accountID: aNumber accountID := aNumber
address ^address
address: aString address := aString
name ^name
name: aString name := aString
phoneNumber ^phoneNumber
phoneNumber: aString phoneNumber := aString
value ^self
</methods> <methods> Examples.Customer1Example <category>displaying</category>
displayString ^accountID printString, '--', name
formatUSPhoneNumber | rawPhone rawSize areaCode prefix suffix separator | rawPhone := self phoneNumber select: [ :ch | ch isDigit]. rawSize := rawPhone size. areaCode := ''. prefix := ''. suffix := ''. separator := '-'. rawSize > 0 ifTrue: [areaCode := rawPhone copyFrom: 1 to: (3 min: rawSize)]. rawSize > 3 ifTrue: [prefix := separator, (rawPhone copyFrom: (4 min: rawSize) to: (6 min: rawSize))]. rawSize > 6 ifTrue: [suffix := separator, (rawPhone copyFrom: (7 min: rawSize) to: (rawSize min: 10))]. self phoneNumber: areaCode, prefix, suffix. self changed: #phoneNumber.
</methods> <methods> Examples.Customer1Example <category>initialize-release</category>
initialize accountID := 0. name := String new. address := String new. phoneNumber := String new.
</methods> <methods> Examples.Customer1Example class <category>instance creation</category>
new ^super new initialize
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class>