Advertisement

Please...help me... (error passing parameters... ) [Newbie Inside]

Started by October 17, 2000 02:12 PM
3 comments, last by KappaMic 24 years, 4 months ago
Hi!, I''ve a little problem passing arrays to procedures...(I''m a newbie... Please help me!) Delphi error: "Incompatible types" Here''s how I''ve declared my procedure: -------------------------------------- procedure BuildFont(Text_Font : string; font : HFONT; gmf : array of GLYPHMETRICSFLOAT); begin Base_Font := glGenLists(256); // Storage For 96 Characters font := CreateFont(-12, // Height Of Font 0, // Width Of Font 0, // Angle Of Escapement 0, // Orientation Angle FW_BOLD, // Font Weight 0, // Italic 0, // Underline 0, // Strikeout ANSI_CHARSET, // Character Set Identifier OUT_TT_PRECIS, // Output Precision CLIP_DEFAULT_PRECIS, // Clipping Precision ANTIALIASED_QUALITY, // Output Quality FF_DONTCARE or DEFAULT_PITCH, // Family And Pitch PChar(Text_Font)); // Font Name ''Comic Sans MS'' SelectObject(h_DC, font); // Selects The Font We Want wglUseFontOutlines( h_DC, // Select The Current DC 0, // Starting Character 255, // Number Of Display Lists To Build Base_Font, // Starting Display Lists 0.0, // Deviation From The True Outlines 0.2, // Font Thickness In The Z Direction WGL_FONT_POLYGONS, // Use Polygons, Not Lines @gmf); // Address Of Buffer To Recieve Data end; Here''s how I''ve defined my vars ------------------------------- Text_Font: HFONT; Text_gmf : array [0..255] of GLYPHMETRICSFLOAT; Here''s how I call the procedure: -------------------------------- BuildFont(''Comic Sans MS'', Text_Font, Text_gmf); I think the reason of the error is that I pass the 3rd parameter in a wrong way... Can you help me?
When you declare routines that take array parameters, you cannot include index type specifiers in the parameter declarations. That is, the declaration

procedure Sort(A: array[1..10] of Integer); // syntax error

causes a compilation error. But

type TDigits = array[1..10] of Integer;

procedure Sort(A: TDigits);

is valid. For most purposes, however, open array parameters are a better solution.
Advertisement
yeah... i''ve read the delphi help too...
Can you modify my code to work? I''ve tryed everything... :((



It''s all ok... the only thing that doesn''t work is how i call the proc...

i beleive that your declarations are correct.

This topic is closed to new replies.

Advertisement