Narcle
2008-09-28 20:55:03
Ok I know what these do, but apparently Nava2 doesn't. So here is my take on them:
Length = It is the "whole number length" which starts at 1 and up.
GetArrayLength = Same as Length?
High = the high point of the array, if the array was only [0] it would return 0. So High starts at 0 and counts up from there.
SetArrayLength = Sets the length of the array from 0 or 1? This is the main point of discussion.
Nava2's way of adding to a array:
L := Length(Array);
SetArrayLength(Array, L + 1);
Array[L] := 'ock';
My way:
SetArrayLength(Array, High(Array) + 1);
Array[High(Array)] := 'ock';
Now whose way works, whose is flawed, whats the problems with how its done?
Length = It is the "whole number length" which starts at 1 and up.
GetArrayLength = Same as Length?
High = the high point of the array, if the array was only [0] it would return 0. So High starts at 0 and counts up from there.
SetArrayLength = Sets the length of the array from 0 or 1? This is the main point of discussion.
Nava2's way of adding to a array:
L := Length(Array);
SetArrayLength(Array, L + 1);
Array[L] := 'ock';
My way:
SetArrayLength(Array, High(Array) + 1);
Array[High(Array)] := 'ock';
Now whose way works, whose is flawed, whats the problems with how its done?