Results 1 to 5 of 5

Thread: Invalid Number of parameters

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Invalid Number of parameters

    One of the simplest scripts conceivable

    Code:
    program blah;
    var
    i:integer;
    
     procedure Count;
     begin
       wait(10)
      begin
       writeln(i,'=I');
       I :=i+1
      end;
     end;
    
    begin
    repeat count
    until I>100
    end.
    can't see whats wrong yet i still get
    Invalid number of parameters at line 9
    Compiling failed.

  2. #2
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    WriteLn takes one parameter, X. You would have to do:

    Simba Code:
    WriteLn('i = ' + IntToStr(I));
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i'm still a noob to this so thanks for the help, i'll keep that in mind

  4. #4
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    Alternatively, you could do:

    Simba Code:
    WriteLn(Format('i = %d', [I]));
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  5. #5
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Just a note, it Lape, WriteLn works like Pascal's WriteLn with a variable number of arguments.

    WriteLn('I = ', I, ';'); works in Lape but not PascalScript.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

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
  •