Home Segments Index Top Previous Next

160: Mainline

The show: message in the following method is sent only if the value of self is outside the 1200-to-1600 range:

Integer method definition • instance 
analyzeCalories 
  (self < 1200) | (self > 1600) 
    ifTrue: [Transcript show: self printString;  
                        show: ' is unreasonable';  
                        cr] 
Workspace
1700 analyzeCalories. 
1400 analyzeCalories. 
1100 analyzeCalories 
Transcript 
1700 is unreasonable 
1100 is unreasonable