Results 1 to 3 of 3

Thread: Constant Arrays

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    Post

    Hello,

    Does anyone know if you can or cannot declare constant arrays in visual basic. just like how you declare:

    private const myfield as integer = 23

    i want to do something like:

    private const myarray(2) as integer = {1,2,3}

    or who knows how it actually would be written. Not me, thats why i'm asking. I get the feeling it's not possible since none of the online documentation mentions anything about it - but i'd love to hear from anyone else who might know either way.

    The purpose of this is to declare a "load table" for a structural engineering application - basically a table of constant values.

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    I think vb doesn't allow constant array.

    But IMO you don't need *really* constant values, just generate them on load and don't modify them?

    ( Long time ago I tried this too, but in another context, I had to redim an array and didn't know the ReDim function )

    ------------------
    Fox
    [email protected]
    [No homepage yet]

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    Post

    Yep. I've implemented it at the moment just initialising the arrays and never changing them.

    It would just make it more correct to be able to declare them "const"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width