Dear "Fellow Rebol Rousers",
 
After having read the docs I have not quite figured out how to accomplish the interleaving of strings.
 
The short and the long of what I want to do is take latitude and longitude coordinate pairs and interleave them with each other.
 
The rational behind this is to place objects that are physically close to each other in the real world close together in computer memory, which we all know is linear and not spherical like the earth. The coordinates are in decimal degrees for the sake of easy manipulation.
 
The max longitude is 180 degrees while the max latitude is 90.
Ignore the issue of positive/negative values as indications of north/south east/west locations.
 
The first segment of the numbers would be interleaved on the basis of the non decimal portion of their values (1st three positions assuming required zero padding).
The balance of the values would be interleaved on each subsequent pair.
 
As an example:
 
latitude value :   043.6732452849
longitude value:   142.8321724625
 
interleaved value: 043142 6783 3221 4572 2846 4925
(spaces are only for readability/illustration)
 
The non decimal portion must be padded with a zero for all latitude values (they never exceed 90).
For longitude the non decimal portion must be padded with zero if the value is <100.
 
I understand that I must convert the numbers to rebol strings to access the necessary functionality required to step through the "number" and pluck out the required portion.
 
My problem:
 
At bare minimum I need to understand the command syntax for stepping and clipping the string at specific points as well as the method for specifying the length of the clipped portion.
 

Any inspiration would be most appreciated.
 
Thanks in advance,
 

Reply via email to