SRL Archive - OSR Help

Problem With Declaring a Procedure


VastlySuperior

2012-09-13 09:51:18

What is wrong in declaring a procedure like this?

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.

Semicolon (';') expected at line 411

Line 411 is the first code I gave.

P1ng

2012-09-13 09:56:13

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( ; )

VastlySuperior

2012-09-13 10:20:16

From: P1ng
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.