Solved

Resizing Variant arrays

Posted on 1997-04-05
1
398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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