473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Dynamic Variable Array Issue

I need to base a variable array using a variable. For example,

ReDim pstrDepSSN(pintRecordCount) as string

The only way to do this is with the ReDim statement but it doesn't permit me to declare the variables as Static so that they hold their values. And if I declare the variables as Static like this

Static pstrDepSSN(pintRecordCount) as string

then I'm not using ReDim so it requires a constant expression rather than the variable pintRecordCount to be used in the parentheses. Does anyone know of a fix or a way to declare Static Dynamic Variable Arrays?

Appreciate any help. Thank you,

Keriana30
Mar 4 '08 #1
3 1455
kadghar
1,295 Expert 1GB
then I'm not using ReDim so it requires a constant expression rather than the variable pintRecordCount to be used in the parentheses. Does anyone know of a fix or a way to declare Static Dynamic Variable Arrays?

Appreciate any help. Thank you,

Keriana30
declare it as a public array, in any module's declarations

public Arr() as double

then, when you change something in any sub, in any module, it'll be kept.

HTH
Mar 4 '08 #2
Killer42
8,435 Expert 8TB
Though I haven't tried, you might find that the "empty brackets" technique also works for Static variables. However, I suspect it won't.
Mar 5 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

Actually, I dint get you clearly...

I guess, you want to Declare an Array, and then ReDim with a Variable Value..

What you can do is in FormLevel , Declare a Variable as Variant.:

Dim MyArr

and then redim to whatever Variable value you want :

ReDim Preserve MyArr(MyCounter)
First Time, When you Redim, you may get an error(For Preserve), you have to keep a Flag for that and Redim,(With or Without Preserve)


Let me know, if your requirement is something else....

Regards
Veena
Mar 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: fivelitermustang | last post by:
Actually, how would I go about allocating a four-dimensional dynamic array? I only know how to make two dimensional dynamic arrays: double **v; v = new double*; for (int i=0; i<C; i++) { v =...
5
by: swarsa | last post by:
Hi All, I realize this is not a Palm OS development forum, however, even though my question is about a Palm C program I'm writing, I believe the topics are relevant here. This is because I...
60
by: Peter Olcott | last post by:
I need to know how to get the solution mentioned below to work. The solution is from gbayles Jan 29 2001, 12:50 pm, link is provided below: >...
5
by: strawberry | last post by:
In the function below, I'd like to extend the scope of the $table variable such that, once assigned it would become available to other parts of the function. I thought 'global $table;' would solve...
0
by: pjr | last post by:
Using VS2005, I dynamically create an event delegate. Code follows question. My method gets the event's parameters and passes them onto a common event handler. My delegate gets called when expected...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
13
by: kwikius | last post by:
Does anyone know what a C99 dynamic array is, and if it will be useable in C++? regards Andy Little
1
by: lumumba401 | last post by:
Hello everybody, i am asking about how to define a bidimensional dynamic array as a global variable to use as incoming variable in a function Let us see , for example in a part of a programm...
1
by: remya1000 | last post by:
i'm using VB.net 2003 application program. i'm trying to convert a VB6 program to VB.NET. The VB6 code i'm trying to convert is shown below. declared g_Share() array in module and trying to add...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.