




Variable Numeric Slot_X
Variable Numeric Slot_Y
Variable Numeric Slot_A
Variable Numeric Slot_Z
Variable Numeric Slot_R

Slot_X            = 1
Slot_Y            = 3
Slot_Z            = 5
Slot_A            = 25
Slot_R            = 27

Stop

Label RestoreVarsAndPositions
	Load Vars
	If v1 <> 0 And v2 <> 0 And v3 <> 0
		Slot(Slot_X) = Reset
		Wait Seconds 0.01
		Slot(Slot_X) = v1
		Wait Seconds 0.01
		'
		Slot(Slot_Y) = Reset
		Wait Seconds 0.01
		Slot(Slot_Y) = v2
		Wait Seconds 0.01
		'
		Slot(Slot_Z) = Reset
		Wait Seconds 0.01
		Slot(Slot_Z) = v3
		Wait Seconds 0.01
		'
		Slot(Slot_A) = Reset
		Wait Seconds 0.01
		Slot(Slot_A) = v4
		Wait Seconds 0.01
	EndIf
Return

' ====================================================================
'  JOG with keyboard
' ====================================================================
Label ExecKeys
	Variable Numeric KeyJog_Speed
	Variable Numeric JogSpeed
	JogSpeed = KeyJog_Speed / 100
	Select True
		Case Key("SHIFT")
			JogSpeed = JogSpeed * 0.1
		Case Key("CTRL")
			JogSpeed = JogSpeed * 0.01
		Case Key("ALT")
			JogSpeed = JogSpeed * 0.001
	EndSelect
	'
	If Key("Right")
		Slot Slot_X = Limit(Slot(Slot_X) + JogSpeed, 0, 100)
	EndIf
Return

' ====================================================================
'  PRINT COORDINATES
' ====================================================================
Label PrintValues
	s1 =       "X=" + Format(Slot(Slot_X), "0.000")
	s1 = s1 + " Y=" + Format(Slot(Slot_Y), "0.000")
	s1 = s1 + " Z=" + Format(Slot(Slot_Z), "0.000")
	s1 = s1 + " R=" + Format(Slot(Slot_R), "0.000")
	's1 = s1 + " A=" + Format(Slot(Slot_A), "0.000")
	Print s1 + CRLF
Return


'WATCH s1
'WATCH Rmax
'WATCH Rmin
'EXEC DestX = 12
