Results 1 to 6 of 6

Thread: Declare Arrays Globally..

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default Declare Arrays Globally..

    You know how you can declare constants globally like:

    Simba Code:
    const
    blah blah = ##;

    How do I do that with an array of integers? Like an array of constant ID's:

    Simba Code:
    const
    GateID = [3506, 3507];  //Doesn't work..

    var
    GateID = [3506, 3507]: Array of Integers  //Doesn't work.

    I tried searching all the tutorials I know of but none of them do this.. instead they do it in the procedures themselves.. So Help me please.
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    You just have to do it in the main loop, not when declaring it.

    Simba Code:
    program ArrayStuff;
    var
      intArray: TIntegerArray;

    //Main Loop
    begin
      intArray := [{values}];
      //rest of main loop
    end.

  3. #3
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    ...Or any subsequent Procs and Funcs. It doesn't have to be the Mainloop...

    Just adding onto NCDS's explanation.

    ~BraK

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  4. #4
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    So you can't make a array const? That would be odd...
    Working on: Tithe Farmer

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

    Default

    It's something to do with how PascalScript works, IIRC. I ran into that problem a while ago.

  6. #6
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Unfortunately, Pascal Script does indeed not support this.
    Hup Holland Hup!

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
  •