DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007

    How to fill a string array at compile time?

    For some reason I'm drawing a blank on this. I want a public string array filled with definitions at compile time. Possible? Something like

    Public strArray(10) as String
    Public Const strArray(1) = "Wee"
    Public Const strArray(2) = "Woo"

    I know I can fill the array at runtime by just sticking the code in a subroutine and calling it at startup. And that's ok. Just wondering if there is another way.

  2. #2
    Join Date
    Apr 2018
    Dim Arr() As string = New String() {"Wee","Woo",etc.}

Similar Threads

  1. fill array with dates unique value
    By luca90 in forum VB Classic
    Replies: 3
    Last Post: 04-13-2011, 03:39 PM
  2. fill array with recordset
    By luca90 in forum VB Classic
    Replies: 1
    Last Post: 11-22-2010, 01:12 PM
  3. Fill Up A Combo Box At Run Time
    By Ariel in forum VB Classic
    Replies: 3
    Last Post: 08-06-2002, 11:42 AM
  4. Run-time Compile ????
    By anonymous in forum VB Classic
    Replies: 2
    Last Post: 12-17-2001, 04:32 AM
  5. How do I fill a 2D array from a text file
    By bill in forum VB Classic
    Replies: 1
    Last Post: 04-29-2000, 11:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.