Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8546343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:59:46+00:00 2026-06-11T12:59:46+00:00

i got some homework on Dephi (never used it before, only c++/java but in

  • 0

i got some homework on Dephi (never used it before, only c++/java but in my universuty we’ve got delphi language subject). Well, i need to make form with moving figures, shown how they collides and stuff like. I started to make a uint like some abstarct class

unit MyFigure;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, Buttons, StdCtrls;

type
tPoint = record
 x,y: Double;
end;

oFigure = class
  c: TCanvas;
  pos: tPoint;
  vel: tPoint;
  r: Double;
  constructor create(coord, vect: tPoint; radius: Double);
  protected
    procedure move();
    procedure draw(); virtual;
  public
    function isIntersected(x:oFigure):boolean;
end;

implementation

  constructor oFigure.create(coord, vect: tPoint; radius: Double);
  begin
    pos.x:= coord.x;
    pos.y:= coord.y;
    vel.x:= vect.x;
    vel.y:= vect.y;
    r:=radius;
  end;

  procedure oShape.draw(); virtual;
  begin

  end;

  procedure oShape.move();
  begin
      pos.x:=  pos.x + vel.x;
      pos.y:=  pos.y + vel.y;
      oShape.draw();

  end;

  function isIntersected(o:oFigure):boolean;
  begin
     if ((oShape.pos.x - o.pos.x)*(oShape.pos.x - o.pos.x) +  (oShape.pos.y - o.pos.y)*(oShape.pos.y - o.pos.y)
          < (oShape.r + o.r)*(oShape.r + o.r)) then Result:=True;
  end;



end.

Then I created it’s child. Well, here i need to call arc method from canvas to draw ball, but it don’t see it and eve says unable to invoke code completion. Whats wrong?

unit Ball;

interface
uses
  MyFigure;   
type

oBall = class(oFigure);
    c: TCanvas;
    procedure draw(); override;
 end;

implementation
   procedure oBall.draw();
    begin
       c.Arc()//PROBLEM!
    end;

end.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:59:48+00:00Added an answer on June 11, 2026 at 12:59 pm

    The Code completion is not invoked because the unit graphics is not specified in the uses clause: Try with

    unit Ball;
    
    interface
    uses
      Graphics, MyFigure;
    

    By the way you don’t seem to instanciate c. You’d need a constructor and a destructor for this. The usuall way would be to pass a TCanvas instance as parameter in the procedure draw(). In the unit oFigure, You define TPoint but TPoint is a native type of the RTL/VCL. You don’t need to to define it. In oFigure you also set some methods as protected but paradoxycally the previous variables are public.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got some problems. Built an applet that has to be used step-by-step. After each
got some problems deploying a java web application on jboss 7.1... Stepped through the
Got some solved troubles, but want to ask, maybe here is another solution. Here
I wrote some java classes, to evaluate/demo different Sorting algorithms. However I got confused
I'm a student, so please bear with me! I've got some introductory Java (using
I'm a student and I got a homework i need some minor help with
I have some homework that I was flying through until I got to this
Not any homework, but seem to have got lost while doing basics, hence asking.
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I got some quite strange errors compiling code under gcc. It tells me that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.