Hi acjacques
just to summarize all good tips coming from community...
here an idea to manage byte for byte the getting and the parsing of NMEA0183 sentence...
looking at here we can get more informations
https://en.wikipedia.org/wiki/NMEA_0183' Steve's suggestion
'whole$ = "": byte$ = " "
'DO
' GET #1, , byte$
' whole$ = whole$ + byte$
'LOOP UNTIL byte$ = CHR$10)
'whole$ = LEFT$(whole$, LEN(whole$) - 2)
'But if we GET one byte$ at time we can just separate each element of the sentence now!
'But since the NMEA sentences are a stream of characters with no fixed length how capture the whole sentence ?
'so
'A tipical GPS sentence is like the following serial stream:
'$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A (followed by CR +LF)
'CONST CR = CHR$(13), LF = CHR$(10), Start = CHR$(36), CheckSum = CHR$(42), Comma = CHR$(44)
", LF = "
", Start = "$", CheckSum = "*", Comma = ","
IniT
SearchStartSentence
GettingFields
ShowResults
Sentence = "$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A" + CR + LF
Byte = ""
Sentence = ""
PRINT "press a key to elaborate NMEA 0183 sentence..":
SLEEP
Index = Index + 1
WHILE Byte
<> Comma
AND Byte
<> CheckSum
AND Byte
<> CR
StringGPS(Index) = StringGPS(Index) + Byte
Byte = TakeByte$
Byte = TakeByte$ ' read next character after delimitator "," or "*" or CR
Sentence = Sentence + "\" + StringGPS(A)
Byte = TakeByte$
TakeByte$ = Byte
this code example creates a txt file containing the example sentence posted by you here and terminated by CF+LF, if file doesn't exist and then go on to read byte for byte and translate the sentence in single fields until the checksum.
Naturally output is on the screen and the fields are in string so you can get value converting string to number using the right variable on the basis of the nature of the number got from sentence.
Thanks to read and try
PS Please don't rem CONST activated and don't unrem CONST deactivated... CHR$ is a internal function and QB64 doesn't like for now to use functions with CONST except some type of color functions if used in a choose manner