Message 1 of 7

Not applicable
05-06-2021
03:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hey everyone,
I have this code that reads the length of the array and also sorts the plane distance and for some reason i get an error
Index was outside the bounds of the array iLogic
Dim PlaneX = Double
Dim PlaneY = Double
Dim lenX = 0
Dim lenY = 0
For Each xVar In PlaneX lenX = lenX + 1 Next For Each xVar In PLaneY lenY = lenY + 1 Next For j = 0 To lenX-2 For h = 0 To lenX-2-j If PlaneX(h) > PlaneX(h + 1) temp = PlaneX(h + 1) PlaneX(h + 1) = PlaneX(h) PlaneX(h) = temp End If Next Next For j = 0 To lenY-2 For h = 0 To lenY-2-j If PlaneY(h) > PlaneY(h + 1) temp = PlaneY(h + 1) PlaneY(h + 1) = PlaneY(h) PlaneY(h) = temp End If Next Next
Solved! Go to Solution.