Thanks Peter, but how do you handle empty fields using split?
For example, a=split(“ABC,DEF,GHI,JKL,MNO,PQ,RST”,",");
needs to return an array like:
a[0]=ABC
a[1]=DEF
a[2]=GHI
a[3]=NULL;
a[4]=NULL;
a[5]=NULL;
a[6]=NULL;
a[7]=JKL;
etc…
Using split the array only contains fields with data, and an NMEA string can often contain fields without data (eg drive through a tunnel, and your lat/long will become null).
This will actually return something like:
a[0]=ABC;
a[1]=DEF;
a[2]=GHI;
a[3]=JKL;
a[4]=MNO;
a[5]=PQ;
a[6]=RST;
which is not what we require.