Solved

Resizing Variant arrays

Posted on 1997-04-05
1
391 Views
Last Modified: 2010-04-03
First, look at my short cut of my code:

var
variant_array : variant;

BEGIN
variant_array := VarArrayCreate([1,1,1,1], varInteger);
...
vararrayredim(variant_array, x);
                      ^^^^^^
You see? I'd like to resize first (or second) one of my
variant array dimensions. How can I do that?
0
Comment
Question by:sanct
1 Comment
 
LVL 5

Accepted Solution

by:
julio011597 earned 50 total points
Comment Utility
You cannot!
As far as i can remember, you can only resize last dimension (check the help).

If you need to resize another dimension, i may suggest to create a new varArray with new dimensions, then copy the vals to it.
Maybe this kind of approach would be more elegant using pointers, so getting rid of old instances of your varArray, but this dipends on your knowledge of pointers (i've worked with Delphi in the past, so cannot be of more help on this now).

-julio
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now