Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: habop73 on February 04, 2023, 07:15:18 pm

Title: Circle - Syntax Error?
Post by: habop73 on February 04, 2023, 07:15:18 pm
I want to draw a Circle with die command-line "Circle (X, Y, Radius);". When compiling the program this line produces the following Syntax Error: "." expected, but "(" found. Why?

Here ist the complete Programm-Code:

PROGRAM Circle;
USES Graph;
VAR
  gd, gm: Integer;

BEGIN
  gd := Detect;
  InitGraph(gd, gm, '');
  if GraphResult <> grOk then
  begin
    Writeln('Fehler beim Initialisieren des Grafikmodus.');
    Halt(1);
  end;
  Circle (100,100,50);
  readln;
  CloseGraph;
END.
Title: Re: Circle - Syntax Error?
Post by: KodeZwerg on February 04, 2023, 07:23:16 pm
I just change Integer to SmallInt and it works like it should.
Title: Re: Circle - Syntax Error?
Post by: bytebites on February 04, 2023, 07:35:33 pm
Change program name.
Title: Re: Circle - Syntax Error?
Post by: Roland57 on February 04, 2023, 08:08:16 pm
And use appropriate tags (button #) when you post code, bitte.  :)
Title: Re: Circle - Syntax Error?
Post by: circular on February 04, 2023, 10:28:53 pm
Maybe the name of the program interferes and it thinks you want something in the program Circle. I suggest to rename the program (at the top of the file).
Title: Re: Circle - Syntax Error?
Post by: TRon on February 05, 2023, 03:37:57 am
Change program name.
... I suggest to rename the program (at the top of the file).

But but but.. but ... but I really want my program to be named circle  :D

Code: Pascal  [Select][+][-]
  1. Graph.Circle(100,100,50);
  2.  
Title: Re: Circle - Syntax Error?
Post by: Bogen85 on February 05, 2023, 03:49:10 am
But but but.. but ... but I really want my program to be named circle  :D
Code: Pascal  [Select][+][-]
  1. Graph.Circle(100,100,50);
  2.  


This forum need a reaction area for each post...

Title: Re: Circle - Syntax Error?
Post by: circular on February 05, 2023, 08:25:01 am
 :D
Title: Re: Circle - Syntax Error?
Post by: loaded on February 05, 2023, 10:05:54 am
In my experience, the closest polygon visually to the circle is the 41 diagonal.
Let this be an example from me.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3. center:TPoint;
  4. radius:double;
  5. diagonal:array of TPoint;
  6. i:integer;
  7. begin
  8.     center:=Point(100,100);
  9.     radius:=50;
  10.     SetLength(diagonal,41);
  11.     for i:=0 to High(diagonal) do
  12.     begin
  13.     diagonal[i]:=point(
  14.     trunc(center.X +radius * sin(i*(2*pi)/High(diagonal))),
  15.     trunc(center.Y +radius * cos(i*(2*pi)/High(diagonal))));
  16.     end;
  17.     canvas.Polyline(diagonal);
  18. end;
Title: Re: Circle - Syntax Error?
Post by: TRon on February 06, 2023, 05:55:11 am
This forum need a reaction area for each post...
:D

Thank you Bogen85 for your faith in my answer  :-[

You have a point though in that things could be improved a bit.

Topic enhancements:
Topic Solved (https://custom.simplemachines.org/index.php?mod=1601)
Topic Solved Mod (https://custom.simplemachines.org/index.php?mod=7)
Topic Solved (https://custom.simplemachines.org/index.php?mod=4339)
rateTopic (https://custom.simplemachines.org/index.php?mod=1066)
Most Popular Topic Today (https://custom.simplemachines.org/index.php?mod=937)
Tagging System For Topics (https://custom.simplemachines.org/index.php?mod=579)

Post enhancement:
Posts I liked (https://custom.simplemachines.org/index.php?mod=4314)
Like Posts (https://custom.simplemachines.org/index.php?mod=3708)
Good Post/Bad Post Mod (https://custom.simplemachines.org/index.php?mod=1890)
Best Answer (https://custom.simplemachines.org/index.php?mod=4274)
Best Answer (https://custom.simplemachines.org/index.php?mod=3803)

Human behaviour:
Post Karma (https://custom.simplemachines.org/index.php?mod=3474)

For some bookkeeping
Message Bookmarks (https://custom.simplemachines.org/index.php?mod=4312)
Topics Created And Participated In (https://custom.simplemachines.org/index.php?mod=4121)

For some fun:
Blabberizer (https://custom.simplemachines.org/index.php?mod=799)

But, I haven't ran a SMF forum in ages (I have no idea about for which version of SMF the posted links are or if they work as intended or not). Also, I can perfectly well understand that adding more features is just a maintenance nightmare (waiting to happen).

Not to mention that using some kind of rewarding system (karma/likes etc) probably will be abused by those that shall not be named  :)

edit: sorry bookmarks seem to be present already.
Title: Re: Circle - Syntax Error?
Post by: habop73 on February 07, 2023, 11:50:48 am
Thanks for the anserws. That all worked fine!
Title: Re: Circle - Syntax Error?
Post by: Bogen85 on February 07, 2023, 02:03:29 pm
But, I haven't ran a SMF forum in ages (I have no idea about for which version of SMF the posted links are or if they work as intended or not). Also, I can perfectly well understand that adding more features is just a maintenance nightmare (waiting to happen).

I always kind of thought the particular look was purposeful, looking like something 15-20 years old and not using markdown was to reflect the "age/maturity" of the project...

Not to mention that using some kind of rewarding system (karma/likes etc) probably will be abused by those that shall not be named  :)

Heh, well, as long as the number doing this low, and the their vote count subject to similar karma, that could work.
Title: Re: Circle - Syntax Error?
Post by: Fred vS on February 07, 2023, 02:16:01 pm

You have a point though in that things could be improved a bit.

Post enhancement:
Posts I liked (https://custom.simplemachines.org/index.php?mod=4314)
Like Posts (https://custom.simplemachines.org/index.php?mod=3708)
Good Post/Bad Post Mod (https://custom.simplemachines.org/index.php?mod=1890)
Best Answer (https://custom.simplemachines.org/index.php?mod=4274)
Best Answer (https://custom.simplemachines.org/index.php?mod=3803)

Human behaviour:
Post Karma (https://custom.simplemachines.org/index.php?mod=3474)

Ho no, please, not those.
Imho, the charm of Lazarus forum it is precisely that there are not all these sorts of medals which give a hierarchy.
The number of posts is enough.
Title: Re: Circle - Syntax Error?
Post by: TRon on February 07, 2023, 02:31:32 pm
Imho, the charm of Lazarus forum it is precisely that there are not all these sorts of medals which give a hierarchy.
I have the same problems/reservations with regards to having some sort of hierarchy.

However, I also believe it can be very helpful to know which answer was the most appropriate. Whether  that is by TS or other more experienced members. I deem the best answer mod one of the better mods in that regards.

Some threads are full of non-sense answers or answers that are repeated (sometimes even weeks later). Sometimes it is hard to filter out all this crap.

Don't forget that some people that drop in from time to time truly believe that post-count (Hero Member, Junior member etc) tells something about the quality of the answers (which is just rubbish).

btw: if this is going to be a full discussion then it might perhaps better to split off this discussion in its own thread. On the other hand I do not believe forum owner have any intention to add additional mods (reason as already provided). In which case there is no need for discussion  :)
Title: Re: Circle - Syntax Error?
Post by: Fred vS on February 07, 2023, 02:39:28 pm
However, I also believe it can be very helpful to know which answer was the most appropriate. Whether  that is by TS or other more experienced members. I deem the best answer mod one of the better mods in that regards.

Ok, and who will decide for the best answer: ChatGPT, Bard or me?  :-\
Title: Re: Circle - Syntax Error?
Post by: TRon on February 07, 2023, 02:44:06 pm
However, I also believe it can be very helpful to know which answer was the most appropriate. Whether  that is by TS or other more experienced members. I deem the best answer mod one of the better mods in that regards.

Ok, and who will decide for the best answer: ChatGPT, Bard or me?  :-\
I quote myself "Whether  that is by TS or other more experienced members"

But other Q&A boards usually let the TS do that. Only TS is able to decide whether the answer was good enough to solve the question/problem. Most people do not even bother though, as it is not mandatory to do so.

It all has to do with etiquette. Some people are raised up very neatly in that they take the time to create an account, dig up a 5 year old thread just to say thank you to the person that provided an answer/solution to a problem.
Title: Re: Circle - Syntax Error?
Post by: Fred vS on February 07, 2023, 02:55:14 pm
However, I also believe it can be very helpful to know which answer was the most appropriate. Whether  that is by TS or other more experienced members. I deem the best answer mod one of the better mods in that regards.

Ok, and who will decide for the best answer: ChatGPT, Bard or me?  :-\
I quote myself "Whether  that is by TS or other more experienced members"

But other Q&A boards usually let the TS do that. Only TS is able to decide whether the answer was good enough to solve the question/problem. Most people do not even bother though, as it is not mandatory to do so.

It all has to do with etiquette. Some people are raised up very neatly in that they take the time to create an account, dig up a 5 year old thread just to say thank you to the person that provided an answer/solution to a problem.

Maybe, the etiquette to add in addition of posts count could be "Registered date" to give a idea when appears the user.
But, imho, no colors please.

(We should do a new topic about this.)

TinyPortal © 2005-2018