[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Resizing Variant arrays

Posted on 1997-04-05
1
Medium Priority
?
408 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 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

834 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