Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Const Array

Status
Not open for further replies.

mindready

Programmer
Dec 22, 2002
15
CA
In Delphi
Const my : array[1..2] of string =('test1','test2');

In VB ???

what's the equivalent for VB?
the only thing I can do is

Const my as string = "Test1"

but an array???

thanks

 

Nope.
Use a variable. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
thanks for reply

and one more thing,
if I use a variable

Dim my() as string

How can I test the variable to know his status? (empty of not)
In the case no Redim has been done on "my"

1- function "IsNull" don't say anything
2- Lbound(my) give me an "subscript out of range error"

so if I try,
MsgBox my(0) I obviously get "subscript out of range error" too

Which function I can use to know if there is some element on the array or not without getting an error?

thanks
 
Well, I guess it is a matter of how it is used:

Dim my(1) As String

my(0)="Something"
my(1)="SomethingElse"

MsgBox my(0) [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
CCINT, sorry I start a new thread to better explain my issue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top