Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetDimensions is missing

1 view
Skip to first unread message

Skybuck Flying

unread,
Jan 13, 2023, 1:55:11 AM1/13/23
to
type
TArrayOfArrayOfArrayOfInteger = array of array of array of integer;

Trying to implement TrySetLength requires knowing the element type of the array, however it also requires knowing the number of dimensions for the third parameter to DynArraySetLength which is a bit of a problem for writing a generic TrySetLength function...

procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt: NativeInt; lengthVec: PNativeint);

There is Length(DynamicArray) to figure out the length of the array, but this only applies to the first dimension.

There is no GetDimensions function for Delphi to be able to acquire the number of dimensions for a dynamic array type...

Bye for now,
Skybuck.

Skybuck Flying

unread,
Jan 13, 2023, 5:24:58 AM1/13/23
to
DynArrayDim actually exists and returns the number of dimensions for a dynamic array.

I came across this in a posting on free pascal forum:

https://forum.lazarus.freepascal.org/index.php?topic=31105.0

The Delphi help files are seperated into different helps, I only accessed the main help file and therefore I could not find any information on/about it.

Delphi also has a system library help file and there one can actually find more information about it.

This seperation of help information kinda sucks. I would recommend at least to create another help file or system that has all help information integrated into one, so that a single search might actually show something...

Keeping the help files seperated is also a nice idea, to cut away clutter from other crap, but still, an integrated help file would help as well !

Bye for now,
Skybuck.
0 new messages