Results 1 to 5 of 5

Thread: Initializing Array Error

  1. #1
    Join Date
    Mar 2010
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Initializing Array Error

    My Script Compiles Correctly, but when I go to run it I get this Procedure Call(I assume) error:
    Code:
    [Runtime Error] : Could not call proc in line 26 in script *:\*\*\*\AddyMiner.scar
    My Line 26 is
    Code:
     WorldsToHopTo:=[10,11,13,14,16,19,20,25,29,30,33,34,35,37];
    The only other time this is used is when I initially declare WorldsToHopTo (It doesn't let me declare + initialize at the same time) This line is
    Code:
      WorldsToHopTo: array[0..13] of integer;
    But Basically I'm wondering if there's a way to just Declare and Initialize everything at once.

    I tried googling around, but I kept getting "semicolon" "colon" and "=" signs needed in weird places. Thanks for any help
    Last edited by chaoyd; 05-20-2010 at 09:42 AM.

  2. #2
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Could you post the script please?



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

    Default

    Try declaring the array as a dynamic array (no range).

  4. #4
    Join Date
    Mar 2010
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ^ Thank You Nielsie that worked <3 . Why does it work when it's dynamic and not static (just curious)?

    EDIT:

    Also, is there a way to declare + initialize the Array, or Am I stuck using two lines?
    Last edited by chaoyd; 05-20-2010 at 10:00 AM.

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    As of right now, it has to be done in two lines.

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
  •