07-02-2005, 06:42 AM
btw torahteen, your subs could be simplified substantially by switching to redim preserve, here's an example:
could be changed to
with redim preserve, the contents of your array don't get erased when it gets redimmed. :wink:
Code:
SUB AddToOpen(x AS INTEGER, y AS INTEGER)
DIM TempOpen(UBOUND(OpenList)) AS PointType
FOR i = 1 TO UBOUND(OpenList)
TempOpen(i).x = OpenList(i).x
TempOpen(i).y = OpenList(i).y
NEXT i
size = UBOUND(OpenList)
REDIM OpenList(size+1) AS PointType
FOR i = 1 TO UBOUND(TempOpen)
OpenList(i).x = TempOpen(i).x
OpenList(i).y = TempOpen(i).y
NEXT i
OpenList(UBOUND(OpenList)).x = x
OpenList(UBOUND(OpenList)).y = y
END SUB
could be changed to
Code:
SUB AddToOpen(x AS INTEGER, y AS INTEGER)
REDIM PRESERVE OpenList(UBOUND(OpenList)+1) AS PointType
OpenList(UBOUND(OpenList)).x = x
OpenList(UBOUND(OpenList)).y = y
END SUB
with redim preserve, the contents of your array don't get erased when it gets redimmed. :wink:
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side...phear