Thats exactly right, they always start at 0. When youOriginally Posted by cairnswm
[pascal]var dArray : Array of Char;
SetLength(dArray, 20);[/pascal]
dArray will be from 0 to 19. Then
[pascal]a := Length(dArray);
// a = 20
b := High(dArray);
// b = 19
c := Low(dArray);
// c = 0[/pascal]
Just be careful how you use Dynamic arrays within other data structures. The effects can be a bit unpredictable. Misuse of them is what would result in a 'memory leak' in your program. Dynamic Arrays within dynamic arrays is also highly UNrecommended(if your program will even function properly). You re pretty much dealing with memory management when you play with them.
Bookmarks