# Polyline Function

Hey,
I need to draw some diagonal and horizontal lines, and after reading the turbo pascal manual I decided that the polyine function would probably be the easiest way. Anyways I set up the code like they had it in the book, and for some reason it won't compile. Does anyone know what i'm missing here? Any help would be greatly appreciated.

program chyeah (input,output);
uses
wincrt;

procedure TMYWindow.Paint (PaintDC: HDC; var PaintInfo:
TPaintStruct);
var
points: array[0..2] of Tpoint;
begin
points[0].x:=10
points[0].y:=15
points[1].x:=10
points[1].y:= 150
points[2].x:= 100
points[2].y:=150
Polyline(PaintDC, @points, 3);
end;

begin
TMYWindow.paint;
end.

• : Hey,
: I need to draw some diagonal and horizontal lines, and after reading the turbo pascal manual I decided that the polyine function would probably be the easiest way. Anyways I set up the code like they had it in the book, and for some reason it won't compile. Does anyone know what i'm missing here? Any help would be greatly appreciated.
:
: program chyeah (input,output);
: uses
: wincrt;
:
: procedure TMYWindow.Paint (PaintDC: HDC; var PaintInfo:
: TPaintStruct);
: var
: points: array[0..2] of Tpoint;
: begin
: points[0].x:=10
: points[0].y:=15
: points[1].x:=10
: points[1].y:= 150
: points[2].x:= 100
: points[2].y:=150
: Polyline(PaintDC, @points, 3);
: end;
:
: begin
: TMYWindow.paint;
: end.

This looks like TP for Windows code. Are you using windows Pascal? If not then Polyline won't exist.

Phat Nat

• : : Hey,
: : I need to draw some diagonal and horizontal lines, and after reading the turbo pascal manual I decided that the polyine function would probably be the easiest way. Anyways I set up the code like they had it in the book, and for some reason it won't compile. Does anyone know what i'm missing here? Any help would be greatly appreciated.
: :
: : program chyeah (input,output);
: : uses
: : wincrt;
: :
: : procedure TMYWindow.Paint (PaintDC: HDC; var PaintInfo:
: : TPaintStruct);
: : var
: : points: array[0..2] of Tpoint;
: : begin
: : points[0].x:=10
: : points[0].y:=15
: : points[1].x:=10
: : points[1].y:= 150
: : points[2].x:= 100
: : points[2].y:=150
: : Polyline(PaintDC, @points, 3);
: : end;
: :
: : begin
: : TMYWindow.paint;
: : end.
:
:
: This looks like TP for Windows code. Are you using windows Pascal? If not then Polyline won't exist.
:
: Phat Nat
:
:
Yes I am using Borland's turbo pascal 1.5