#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# Polyline Function

Posts: 3Member
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.

· ·

• Posts: 757Member
: 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

· ·
• Posts: 3Member
: : 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
· ·