
ConvertToPosition
End


Variable Numeric CurrentPos
Label ConvertToPosition
	
	s2 = Chr(1) + Chr(3)+ Chr(4)+ Chr(0) + Chr(3) + Chr(255) + Chr(255) + Chr(222) + Chr(222)
	
	'CurrentPos = Val(Mid(s2, 7, 1))
	'CurrentPos = CurrentPos + Val(Mid(s2, 6, 1)) * 256
	'CurrentPos = CurrentPos + Val(Mid(s2, 5, 1)) * 65536
	'CurrentPos = CurrentPos + Val(Mid(s2, 4, 1)) * 65536 * 256
	
	CurrentPos = Val(Mid(s2, 7, 1))
	CurrentPos = CurrentPos + Val(Mid(s2, 6, 1)) * 256
	CurrentPos = CurrentPos + Val(Mid(s2, 5, 1)) * 65536
	CurrentPos = CurrentPos + Val(Mid(s2, 4, 1)) * 65536 * 256
Return





'---------------------------------------------------
'01 03 00 66 00 02 24 14       'ask position
'01 03 04 00 03 FF FF 0B 83    'current position


'WATCH COM_Status
'WATCH len(s2)
'WATCH val(
