Results 1 to 4 of 4

Thread: Declaring constant arrays?

  1. #1
    Join Date
    Jun 2009
    Posts
    177
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Question Declaring constant arrays?

    I'm just wondering, is there a possible way to declare constant arrays? I've tried the following code, but the SCAR compiler gives me an error.
    Code:
    const
         Number = [333, 4355];
    Currently, I'm using a variable as an alternative.
    Code:
    var
       Number : TIntegerArray;
    Code:
    Number := [333, 4355];
    However, using constants seems to keep code more clear and efficient .

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im nearly certain you cannot declare a constant as an array, thus you will have to use an array. A record may do nicely if your trying to do a user defined option or something
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Sadly, I'm pretty sure Blumblebee is correct. Despite the fact that both Pascal and Delphi have ways of declaring arrays as constants, it appears that SCAR does not.

  4. #4
    Join Date
    Jun 2009
    Posts
    177
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah, okay... I guess I'll have to stick with variables. Thanks for informing me .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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