[futurebasic] Hex???

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2004 : Group Archive : Group : All Groups

From: John Clark <Aeronaut@...>
Date: Mon, 15 Mar 2004 22:31:41 +1100
Hello Out there,

I'm kludging together some GPS NMEA 0183 thing. The manuel says"

         The optional checksum field consists of a "*" and two hex digits
         representing the exclusive OR of all characters between, but not
         including, the "$" and "*".  A checksum is required on some
         sentences.

Hex digits. I must have left the room then...

My old checksum routine goes...

Clear Local
LOCAL FN CalcSum$ (Out$)                      'Calculate the Xor-ed 
checksum
   checksum = 0
   FOR n = 1 TO LEN(Out$)
     checksum = checksum XOR ASC(MID$(Out$, n, 1))
   NEXT
checksum$ = FN Stripper$(str$(checksum$))
END FN = checksum$

How do I convert the numbers to hex??

Best

JC

=============================================================
John Clark
Aeronaut Automation
Unit 42, 5 Ponderosa Parade, Warriewood NSW 2102,
Australia
Phone:   61 2 9997 2842              Fax: 61 2 9979
5615
email:   JohnC@...
http://www.Aeronaut.org

=============================================================