For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > February 2005 > Define constant array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Define constant array
Marko Pinteric

2005-02-28, 8:55 am

Hello,

I am well acquainted with defining constants, however I do not know how
to define array constant. Eg

Const dayofw(7) = "monday", "tuesday", ....

Is that possible to accomplish?

Thank you for the answers,

Marko
Mike D Sutton

2005-02-28, 8:55 am

> I am well acquainted with defining constants, however I do not know how
> to define array constant. Eg
>
> Const dayofw(7) = "monday", "tuesday", ....
>
> Is that possible to accomplish?


Unfortunately VB does not support constant arrays.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: Http://EDais.mvps.org/


Rick Rothstein

2005-02-28, 8:55 am

> I am well acquainted with defining constants, however I do not know
how
> to define array constant. Eg
>
> Const dayofw(7) = "monday", "tuesday", ....
>
> Is that possible to accomplish?


No, VB doesn't support constant arrays. However, if you are looking for
day of the w names, VB6 has a WDayName function available.

For X = 1 To 7
Debug.Print WDayName(X)
Next

Rick

J French

2005-02-28, 8:55 am

On Mon, 28 Feb 2005 08:34:15 +0100, Marko Pinteric
<marko@pinteric.com> wrote:

>Hello,
>
>I am well acquainted with defining constants, however I do not know how
>to define array constant. Eg
>
>Const dayofw(7) = "monday", "tuesday", ....
>
>Is that possible to accomplish?


No, it is one of the annoying things that are 'missing' in VB


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com