Results 1 to 3 of 3

Thread: Problem With Declaring a Procedure

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Problem With Declaring a Procedure

    What is wrong in declaring a procedure like this?

    Simba Code:
    Procedure UniversalWalker(Choice:Integer,Walk:String);

    I want to pass On 2 values to this procedure, The first one is an integer and the Second one a string, I need both these variables to make the right selections where a path should walk and what maps to call for the walking.

    But I get this error when trying to compile it.

    Simba Code:
    Semicolon (';') expected at line 411

    Line 411 is the first code I gave.

  2. #2
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Simba Code:
    Procedure UniversalWalker(Choice: Integer; Walk: String);

    That should work for you. Between different types of variables needs to be another semi-colon

    Example:
    Simba Code:
    procedure Test(Int1, Int2: Integer; S1: String; Ext: Extended);
    As you can see between variables of the same type (e.g. integer) they are separated by a comma( , )

    Between variables of different types (e.g. string, extended) they are separated by a semi-colon( ; )
    Last edited by P1ng; 09-13-2012 at 02:10 PM.

  3. #3
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by P1ng View Post
    Procedure UniversalWalker(Choice: Integer; Walk: String);

    That should work for you. Between different types of variables needs to be another semi-colon

    Example:
    procedure Test(Int1, Int2: Integer; S1: String; Ext: Extended);
    As you can see between variables of the same type (e.g. integer) they are separated by a comma(,)

    Between variables of different types (e.g. string, extended) they are separated by a semi-colon(
    Thanks P1ng, you are always so helpful, I figured that out but did not know the reason why it was required, you have now clarified it for 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
  •