PDA

View Full Version : Utility of ARRAYREAD



Alberto
- 3rd August 2016, 22:40
The ARRAYWRITE command is clear to me and I have used it succesfully in a program to write to an oled display. Totaly unclear to me is the use of ARRAYREAD command. Can somebody post a snippet with a practical example on how and when to use arrayread?

Thank you so much for any help you will give me on this subject.


Alberto

MichelJasmin
- 4th August 2016, 03:31
You can use it to parse arrays. Here is how I'm using it to parse a NMEA string from a GPS:




...

'Parsing GGA
'$GPGGA,193931.000,4600.0000,N,07100.0000,W,1,05,1 .5,212.0,M,-28.5,M,,0000*6A

ARRAYread BufferGPS, BFLN_GPS_BUF, Err_ParseNMEA, _
[wait("$GPGGA,"), str GPSTime\6, wait(","), _
str Latitude\9, wait(","), str Lat_NS\1, wait(","), _
str Longitude\10, wait(","), str Long_EW\1, wait(","), _
dec GPSFixQual, dec SatCount, str HDOP\3\","]

NMEAValid = 1

Err_ParseNMEA:
return

Alberto
- 4th August 2016, 15:32
Thank you MichelJasmin for the useful snippet! Now it is much more clear (for me) how to use the ARRAYREAD command.

Alberto