Results 1 to 5 of 5

Thread: Closing parenthesis expected at line 7

  1. #1
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Closing parenthesis expected at line 7

    I'm trying to set up a static string array and i'm getting the error message 'Closing parenthesis expected at line 7'.

    Usually i can fix this myself, but i can't figure out what is wrong with it.

    Would somebody be able to help me?

    Line 7:
    Code:
    words:array[1..5] of string = ('test1', 'test2', 'test3', 'test4', 'test5');
    I have a closed parenthesis? Any idea what it could be?

  2. #2
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I have fixed it by using:

    Code:
    words[1] := 'test1';
    words[2] := 'test2';
    words[3] := 'test3';
    words[4] := 'test4';
    words[5] := 'test5';
    I would still like to know why that wasn't working though.

    Any ideas?

  3. #3
    Join Date
    Feb 2013
    Location
    The Boonies
    Posts
    203
    Mentioned
    9 Post(s)
    Quoted
    70 Post(s)

    Default

    Is everything good on line 6? Sometimes if the line before the error lacks something, it will say the error is on the next line, at least anecdotally... Are you able to post the entire source?

    edit: i was blind!
    Last edited by Lama; 08-12-2018 at 07:38 PM.

  4. #4
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Simba Code:
    program new;

    var
      words: array[1..5] of string = ['test1', 'test2', 'test3', 'test4', 'test5'];

    begin
      writeLn(words);
    end.

    Code:
    Compiled succesfully in 696 ms.
    [test1, test2, test3, test4, test5]
    Succesfully executed in 0 ms.
    Arrays use brackets, not parentheses
    Last edited by KeepBotting; 08-12-2018 at 07:25 PM.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  5. #5
    Join Date
    May 2018
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Simba Code:
    program new;

    var
      words: array[1..5] of string = ['test1', 'test2', 'test3', 'test4', 'test5'];

    begin
      writeLn(words);
    end.

    Code:
    Compiled succesfully in 696 ms.
    [test1, test2, test3, test4, test5]
    Succesfully executed in 0 ms.
    Arrays use brackets, not parentheses
    Thank you! Works perfectly.

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
  •