Shop OBEX P1 Docs P2 Docs Learn Events
How to de-encapsulate data in an elegant manner — Parallax Forums

How to de-encapsulate data in an elegant manner

rfman78rfman78 Posts: 12
edited 2008-05-01 18:25 in General Discussion
Hi folks,
I'm sort of unfamiliar with the java String Class and the methods available to it,

But my first question. Does the Javelin support the Sqrt function? I need to utilize Pythagorean theorem to calculuate distances between GPS coordinates..

Anyhow, here's what I want to do.· I want to xmit a series Unit IDs and their associated GPS coordinates.
So for example, say we have:

ID··········· GPS COORD
1············· (2,4)
2············· (6,7)
3············· (5,2)
4············· (2,5)

I have encapsulated this in a string that looks like:
L!I1X2Y4I2X6Y7I3X5Y2I4X2Y2E

where the format is I,Unit ID,X,X Coord,Y,Y coord, E for End

This data is transmitted and received as a string on the other end.
What I'm confused on doing is coming up with an elegant way to unpack this data into a format that can be stored in an array.

Is there a way to search for Characters (I, !, etc)

Please help!

·

Comments

Sign In or Register to comment.