I am using some code that Scott Rossi published and I would like to understand why it does not throw an error :
Code: Select all
command updateMyValue
local theRange, thePercent, theAmount, theStartValue
local theArcValue,
local tGuageValue, tStartValue, tEndValue
lock screen
put abs(myEndValue() - myStartValue()) into theRange
put ((myGaugeValue() - myStartValue())/theRange) into thePercent
if myStartValue() > myEndValue() then put (1 - thePercent) into thePercent
put round(thePercent * 360) into theAmount
-- WHY IS THIS "IF" ALLOWED WITHOUT AN "END IF" ?
if myFillDirection() is "clockwise" then
put (450 - theAmount) into theStartValue
else put 90 into theStartValue
put theAmount into theArcValue
set startAngle of myFill() to theStartValue
set arcAngle of myFill() to theArcValue
set label of myDisplay() to myGaugeValue()
unlock screen
end updateMyValue
I have checked the dictionary and confirmed that all the examples of multi line if statements end with an end if. In the example above it is not clear , to me, what gets actioned following the else statement. Have I missed something obvious?