Qbasicnews.com

Full Version: Array handling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a problem in how to handle data from an HPGL file. I will be given data for all the "segments" of a shape defined in HPGL code.
The segments all fit together to form a closed shape, but the order will not be correct nor will the direction of travel along each segment necessarily be correct. I plan to separate each segment in the binary file and record the beginning and end X-Y coordinates in an array along with the LOC(1) for each. This will allow comparison of the X and Y values of one segment to the others in order to find which segment is to be used next and to reverse the direction within the segment if necessary. For a given "segment" the values will be in the form of:

PA12345,23456;PD 45677 (this could be the beginning point)

The PA values are at the start of the segment and the #45677 is the LOC(1) of it. Another data set describes the End values.

Since the program may have (5) segments or (5000), how do I dimension the array? Could I put both the Start and End values for the same segment in one location?

Thanks for your inputs,
Jack C.