Leading zeroes of string numbers?

mjcoon

Well-Known Member
Licensed User
I'm displaying the ID of GPS satellites using the suggested code in the Help, which declares the GPS data array without explicit data type, so presumably is string.
B4X:
Private Type (ID, SignalStrength, Azimuth, Elevation, Used) sats(0)

The NMEA data appears to deliver the ID with leading zeroes, and on PC either compiled (with 6.90) or under IDE the leading zero is visible.

However on PPC, with the real GPSDriver, the leading zero is suppressed. This would be easy to work-around using a Format(), but why does it arise?

Mike.
 

mjcoon

Well-Known Member
Licensed User
Do you want to keep the leading zeroes?

Which library and which method(s) exhibit this effect on the desktop? And which method(s) on the device?

The leading zeroes seem to be the convention.

On desktop I get data from GPSSerial.dll via Gpsdriver.GetSatellitesData; on device same from real GPSDriver.dll with same method.

The display is via Form.FDrawString().

On the device the $GPGSV data seems to have the leading zeroes (though I haven't checked the formats).

Mike.
 

agraham

Expert
Licensed User
Longtime User
On desktop I get data from GPSSerial.dll via Gpsdriver.GetSatellitesData
I assume you mean GPSSerial.dll.GetSatellitesData. There is no direct relationship between the GPSSerial and GPSDriver code. GPSSerial is just a simulation of GPSDriver offering the same interface. GPSDriver returns the data obtained from the Windows Intermediate GPS Driver, GPSSerial returns what it picks out of the NMEA sentences so the leading series are present in the data from the GPS itself. Presumably the Windows Intermediate driver strips leading zeroes when it receives the same data.
 

mjcoon

Well-Known Member
Licensed User
Top