Doh!
5 less
 Code:
; ChangeLamp.kix
;	Automated lightbulb changer
 
Dim $R, $O, $N, $S, $I
 
"Please enter lightbulb maintenance reference: " Gets $R
 
$O=GetObject("Lamp:/"+$R)
$S=GetObject("Switch:/"+$R)


$S.Toggle
$I=$OState | $O.Illuminated
$S.Toggle
 
If $I 
	If $O.Type="Bayonet"
		$O.Push
		$O.Rotate(-90)
		$O.Pull
		:GetNewLampBayonet
		$N=CreateObject("Lamp.Bayonet")
		$N.Push
		If $N.IsHot
			$S.Toggle
			$=RunFingersUnderColdWater(@WKSTA)
			If $N.Broken Goto "GetNewLampBayonet" EndIf
		EndIf
		$O.Rotate(90)
	Else ;$O.Type="Edison Screw"
		While Not $O.Released
			$O.Rotate(-180)
		Loop
		:GetNewLampScrew
		$N=CreateObject("Lamp.Screw")
		While $N.Loose
			$N.Rotate(180)
			If $N.IsHot
				$S.Toggle
				$=RunFingersUnderColdWater(@WKSTA)
				If $N.Broken Goto "GetNewLampScrew" EndIf
			EndIf
		Loop
	EndIf

	$S.Toggle
	$I=$OState | $O.Illuminated
	$S.Toggle
	If $I
		"Lamp successfully changed and tested"+@CRLF
	Else
		"Lamp still not working.  Please try running FixFuse.kix then retry ChangeLamp.kix"+@CRLF
	EndIf
Else
	"Lamp is OK, no need to change"+@CRLF
;EndIf
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)