SRL Archive - OSR Help

How to correctly setup a TPoint


Parade

2012-06-24 23:02:08

I'm playing around with SPS_BlindWalk and setting up the TPoint, something must have gone askew. I get an error:

[Error] (30:35): Type mismatch at line 29


Do you not set them up like an array? Here is a snippet of my code:

var
ToGold: TPoint;

procedure MyPaths;
begin
ToGold := [Point(339, 423)]; //This is line 29
end;

procedure BlindWalkToGold;
begin
SetRun(True);
MakeCompass('n');
SPS_BlindWalk(ToGold);
end;


Edit: Also, if it means anything, I have actual TPointArrays being setup in the MyPaths procedure too.

Nebula

2012-06-24 23:04:36

var
ToGold: TPoint;

procedure MyPaths;
begin
ToGold := Point(339, 423);
end;

procedure BlindWalkToGold;
begin
SetRun(True);
MakeCompass('n');
SPS_BlindWalk(ToGold);
end;

Runaway

2012-06-24 23:07:11

TPoint:

var
ToGold: TPoint;

procedure MyPaths;
begin
ToGold := Point(339, 423);
end;

TPointArray:

var
ToGold: TPointArray;

procedure MyPaths;
begin
ToGold := [Point(339, 423), Point(375, 401), {etc...}];
end;

A TPoint is just a type, not an array :)

Edit: ^ Nebula = :ninja:

wantonman

2012-06-24 23:12:31

i dont use sps… but type mismatch is when the "type" of variable you use is mismatched.

like if you declare a variable as a tpoint but u put it in a function that requires a tpointarray then you get a type mismatch… though if you want to use a tpointarray in a function that calls for a tpoint you can do something similar to this


var
tpa1:tpointarray;

begin
tpointfunction(tpa1[i]);
end


Parade

2012-06-24 23:12:37

Thank you so much! It's always the simple things that you don't catch. hahah