'From Squeakland 3.8.5976 of 25 August 2004 [latest update: #403] on 17 March 2005 at 12:47:19 am'! "Change Set: demousing-sw Date: 17 March 2005 Author: Scott Wallace Tweaks the error message presented upon zero-divide in etoy tile scripts."! !Player methodsFor: 'misc' stamp: 'sw 3/17/2005 00:47'! beNotZero: aNumber "This is a runtime check if the arg to divide in a script is zero. If it is, put up a warning message. Return 0.001 instead of 0. Note the time. If fails again within 1 min., don't tell the user again." aNumber = 0 ifFalse: [^ aNumber]. "normal case" "We have a problem" TimeOfError ifNil: [TimeOfError _ Time totalSeconds] ifNotNil: [(Time totalSeconds - TimeOfError) > 45 ifTrue: [ TimeOfError _ Time totalSeconds. "in case user interrupt and reenter" self inform: 'Dividing by zero makes a number too large for even a Sorcerer to handle. Please change your script.' translated. TimeOfError _ Time totalSeconds]]. ^ 0.001! !