groog
08-05-2010, 04:32 AM
I'm having trouble getting custom functions made. Here is an example function-
function findGTM(mon:Array of String);
begin
k := GetArrayLength(mon) - 1;
k := k/3;
if(findColor(x, y, strToInt(mon[0]), xs, ys, xe, ye))then
begin
...Some stuff
while(found)do
begin
....More stuff
if(i = k)then
begin
return true;
end;
...xxx
end else
begin
return false;
end;
end;
end;
end;
I obviously need it to return the value "true" or "false". But I get this error message-
[Error] (13:38): colon (':') expected at line 12
Compiling failed.
Being the first line-
function findGTM(mon:Array of String);
So what can I do to get my function working? Works A-OK as a procedure (without the returning bit of course).
function findGTM(mon:Array of String);
begin
k := GetArrayLength(mon) - 1;
k := k/3;
if(findColor(x, y, strToInt(mon[0]), xs, ys, xe, ye))then
begin
...Some stuff
while(found)do
begin
....More stuff
if(i = k)then
begin
return true;
end;
...xxx
end else
begin
return false;
end;
end;
end;
end;
I obviously need it to return the value "true" or "false". But I get this error message-
[Error] (13:38): colon (':') expected at line 12
Compiling failed.
Being the first line-
function findGTM(mon:Array of String);
So what can I do to get my function working? Works A-OK as a procedure (without the returning bit of course).