Solved

Resizing Variant arrays

Posted on 1997-04-05
1
393 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
ID: 1335169
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

896 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

17 Experts available now in Live!

Get 1:1 Help Now