Results 1 to 3 of 3

Thread: const array?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    DC
    Posts
    2
    How do I create an array of constants? I'm converting a C program to VB that has a 256 byte array defined as
    unsigned intCRCArray[256] = {27,123, ... 40 }

    In VB, I could individually assign each array element such as:

    Dim CRCTable(256) As integer
    CRCTable(0) = 27
    CRCTable(1) = 123
    ...
    CRCTable(255) = 40

    but this is tedious to type in. I want to do something like:
    const CRCTable(256) as integer = 27, 123, ..., 40
    so that I can simply copy-paste the array from my C program, but this generates an error. Is there a way to do this?

    Thanks,
    Randy

  2. #2
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    Hi,
    try:
    Code:
    dim CRCTable
    
    CRCTable = Array(27,123,.......40)
    Hope this helps

    Shaun
    Web/Application Developer
    VB6 Ent (SP5), Win 2000,SQL Server 2000

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    DC
    Posts
    2
    thanks!

    Randy

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