473,379 Members | 1,252 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,379 software developers and data experts.

Reposting:About constant

Hi everyone
I'm posting again this question as my system was down at time of the first
posting...well something in the newsgroups was down.

I'd like to know how i should declare a constant as an array with two
dimension. I've tried the following but seems the syntax is somehow wrong.
Can someone help me in doing so or any clue would be fully appreciate.

Here is my bugged code:

Const TableDOB(1..3,1..2) of String =
(("John","760303"),("Paul","670403"),("Georges","6 80902"))
Many thanks to all

Jul 17 '05 #1
6 6433
You can't. Constants have to be, well, constant. Arrays are not constant.

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"sruojlim" <pa***************@yahoo.ca> wrote in message
news:WZ******************@news20.bellglobal.com...
: Hi everyone
: I'm posting again this question as my system was down at time of the first
: posting...well something in the newsgroups was down.
:
: I'd like to know how i should declare a constant as an array with two
: dimension. I've tried the following but seems the syntax is somehow
wrong.
: Can someone help me in doing so or any clue would be fully appreciate.
:
: Here is my bugged code:
:
: Const TableDOB(1..3,1..2) of String =
: (("John","760303"),("Paul","670403"),("Georges","6 80902"))
:
:
: Many thanks to all
:
:
:

Jul 17 '05 #2
sruojlim schreef:
Hi everyone
I'm posting again this question as my system was down at time of the first
posting...well something in the newsgroups was down.

I'd like to know how i should declare a constant as an array with two
dimension. I've tried the following but seems the syntax is somehow wrong.
Can someone help me in doing so or any clue would be fully appreciate.

Here is my bugged code:

Const TableDOB(1..3,1..2) of String =
(("John","760303"),("Paul","670403"),("Georges","6 80902"))
Many thanks to all

There is no such thing as a "array constant" in Visual Basic. Simply use
a variable and use it member by member. If you really want to do it all
in one statement you can use the Array function, like:

Array(Array("John","760303"), Array("Paul","670403"),
Array("Georges","680902"))

But it's not what I would call readable code.

Best regards
Jul 17 '05 #3
Thank you and really sorry for this galaxy like delay

jm
"Randy Birch" <rg************@mvps.org> a écrit dans le message de news:
2I********************@rogers.com...
You can't. Constants have to be, well, constant. Arrays are not constant.

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"sruojlim" <pa***************@yahoo.ca> wrote in message
news:WZ******************@news20.bellglobal.com...
: Hi everyone
: I'm posting again this question as my system was down at time of the
first
: posting...well something in the newsgroups was down.
:
: I'd like to know how i should declare a constant as an array with two
: dimension. I've tried the following but seems the syntax is somehow
wrong.
: Can someone help me in doing so or any clue would be fully appreciate.
:
: Here is my bugged code:
:
: Const TableDOB(1..3,1..2) of String =
: (("John","760303"),("Paul","670403"),("Georges","6 80902"))
:
:
: Many thanks to all
:
:
:

Jul 17 '05 #4
Thank you and really sorry for this galaxy like delay

jm
"Randy Birch" <rg************@mvps.org> a écrit dans le message de news:
2I********************@rogers.com...
You can't. Constants have to be, well, constant. Arrays are not constant.

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"sruojlim" <pa***************@yahoo.ca> wrote in message
news:WZ******************@news20.bellglobal.com...
: Hi everyone
: I'm posting again this question as my system was down at time of the
first
: posting...well something in the newsgroups was down.
:
: I'd like to know how i should declare a constant as an array with two
: dimension. I've tried the following but seems the syntax is somehow
wrong.
: Can someone help me in doing so or any clue would be fully appreciate.
:
: Here is my bugged code:
:
: Const TableDOB(1..3,1..2) of String =
: (("John","760303"),("Paul","670403"),("Georges","6 80902"))
:
:
: Many thanks to all
:
:
:

Jul 17 '05 #5
Thank you for answering...I know, i'm a "little" late, well maybe more like
galaxies ago.

jm

"Dikkie Dik" <Ab***@SpamBusters.com> a écrit dans le message de news:
yF*************@newsfe01.lga...
sruojlim schreef:
Hi everyone
I'm posting again this question as my system was down at time of the
first posting...well something in the newsgroups was down.

I'd like to know how i should declare a constant as an array with two
dimension. I've tried the following but seems the syntax is somehow
wrong.
Can someone help me in doing so or any clue would be fully appreciate.

Here is my bugged code:

Const TableDOB(1..3,1..2) of String =
(("John","760303"),("Paul","670403"),("Georges","6 80902"))
Many thanks to all

There is no such thing as a "array constant" in Visual Basic. Simply use a
variable and use it member by member. If you really want to do it all in
one statement you can use the Array function, like:

Array(Array("John","760303"), Array("Paul","670403"),
Array("Georges","680902"))

But it's not what I would call readable code.

Best regards

Jul 17 '05 #6
Thank you for answering...I know, i'm a "little" late, well maybe more like
galaxies ago.

jm

"Dikkie Dik" <Ab***@SpamBusters.com> a écrit dans le message de news:
yF*************@newsfe01.lga...
sruojlim schreef:
Hi everyone
I'm posting again this question as my system was down at time of the
first posting...well something in the newsgroups was down.

I'd like to know how i should declare a constant as an array with two
dimension. I've tried the following but seems the syntax is somehow
wrong.
Can someone help me in doing so or any clue would be fully appreciate.

Here is my bugged code:

Const TableDOB(1..3,1..2) of String =
(("John","760303"),("Paul","670403"),("Georges","6 80902"))
Many thanks to all

There is no such thing as a "array constant" in Visual Basic. Simply use a
variable and use it member by member. If you really want to do it all in
one statement you can use the Array function, like:

Array(Array("John","760303"), Array("Paul","670403"),
Array("Georges","680902"))

But it's not what I would call readable code.

Best regards

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Scotter | last post by:
Please forgive me for reposting; last title didn't quite say it right. I have an ASP application I wrote in vbScript so this is not .Net. There are 20 nearly identical versions of this...
1
by: Dirk Försterling | last post by:
Hi, sorry for reposting, but it seems my message just hit nothing but air. If I posted to the wrong list or did something else wrong with the message, please let me know. I really want to...
21
by: John Welch | last post by:
Sometimes I post a question here and someone answers it quickly with an answer like "well, I don't know much about this, but maybe such and such." While I completely appreciate their effort, I...
4
by: AMeador | last post by:
I have a form that should come up blank (no data in the text boxes, etc...). I want the user to be able to fill in the contols on the form and then save the data to a SQL Server database. My plan...
0
by: Ersin Gençtürk | last post by:
Hi , I know that this is something belongs to IE but , I think sometimes asp.net developers encounter this problem. Sometimes we need to repost another asp.net page but IE is opening a page that...
35
by: rebeccatre | last post by:
hi can Variant archiving setTimout('.. capability be done without using it? :-)
8
by: Stefano Sabatini | last post by:
Hi all, I'm encountering this while trying to implement a factory singleton method to generate objects. The singleton has a static map which binds a static creation function defined in each...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.