Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.

Leading zeroes of string numbers?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2010, 09:22 PM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default Leading zeroes of string numbers?

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.
Code:
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.
Reply With Quote
  #2 (permalink)  
Old 06-24-2010, 05:42 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,714
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Do you want to keep the leading zeroes?
Reply With Quote
  #3 (permalink)  
Old 06-24-2010, 06:41 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Which library and which method(s) exhibit this effect on the desktop? And which method(s) on the device?
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #4 (permalink)  
Old 06-24-2010, 07:25 PM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by Erel View Post
Do you want to keep the leading zeroes?
Quote:
Originally Posted by agraham View Post
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.
Reply With Quote
  #5 (permalink)  
Old 06-24-2010, 08:34 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by mjcoon View Post
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.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #6 (permalink)  
Old 06-25-2010, 08:03 AM
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by agraham View Post
I assume you mean GPSSerial.dll.GetSatellitesData.
Sorry, yes, exactly that. I was quoting verbatim but that is misleading in this case. I'm using my almost-single-source solution per http://www.basic4ppc.com/forum/addit...html#post34993 so the source is the same even though the object is really from GPSSerial.dll.

I'll put the leading zero in with a Format(id, "d2").

Mike.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How split string in a string with numbers? sitajony Questions (Windows Mobile) 4 04-26-2010 06:43 PM
Leading zero(s) for numeric or string type variable not saved in database. mozaharul Questions (Windows Mobile) 1 10-26-2008 04:18 PM
The same random numbers LineCutter Questions (Windows Mobile) 4 10-16-2008 05:05 PM
Numbers lock key davelew1s Questions (Windows Mobile) 0 06-14-2008 07:26 PM
B4PObject numbers Louis Questions (Windows Mobile) 1 05-14-2008 08:51 PM


All times are GMT. The time now is 04:05 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0