SRL Archive - Delphi/FPC Help and Tutorials

Are pascal and delphi the same thing?


g0tp0t

2010-03-21 22:28:12

I posted my code below, but i cant get my small circle to revolve slowly about a point. Can someone please help?







OLD MESSAGE:I have been seeing the two languages together everywhere, are they the same/related?

Wanted

2010-03-21 22:29:14

Related, yes.

Same, no.

x[Warrior]x3500

2010-03-21 22:29:45

pascal and delphi are very similar, but i believe delphi is object based and pascal isnt

g0tp0t

2010-03-21 22:41:53

does that mean i can post here for help with pascal?

i luffs yeww

2010-03-21 22:43:07

Or here.

Wanted

2010-03-21 22:43:32

Yes, just make sure you tell people what you are doing/in what language exactly.

g0tp0t

2010-03-21 22:49:44

ok, i am using free pascal and i am trying to make a small circle orbit around a point, this is my code:

Program Graphics;
Uses Crt, Graph;
Var GrDriver, GrMode, x: Integer;
{These vars are needed to initialize the graphics}
ch : char;
Begin
ch := #1;
ClrScr;
GrDriver := 0;
GrMode := 0;
InitGraph (GrDriver, GrMode, '');
{InitGraph is used to initialize the graphics mode}

If GraphResult <> 0 Then
{If an error occurs, print an error message}
Begin
WriteLn ('Couldn''t initialize graphics!');
Halt (0); {This will halt the program}
End;

while not false do
begin
for x:= 1 to 60 do
clrscr;
circle(150 + round(sin(x/10)*100),150 + round(cos(x/10)*100),4);
wait(1000);
end;

Repeat
ch := ReadKey;
Until ch = #27;
{Repeat until ESC (chr value 27) is pressed}

CloseGraph;
{CloseGraph is used to clear the graph-memory
once the program is done.}

End.


i need the circle to rotate slow enough that i can see it but if i add any delay then it doesnt move at all. i tried wait but that doesnt exist apparently

Nava2

2010-03-22 00:54:37

You have to sleep the thread.

g0tp0t

2010-03-22 11:19:11

is that an answer to my code or to my report? lol

Either way, i dont know how or what that means:tongue:

Nava2

2010-03-22 11:47:05

Try the alias 'sleep' otherwise google fpc wait method.

Also, fpc is considered object/turbo pascal, it's not the sane as Delphi, but it's not that different either.

g0tp0t

2010-03-22 11:58:42

OK, so sleep replaces my wait, lol I'm trying that now

======

Okay, I replaced it with sleep(100), but now the circle doesn't appear at all…?

======

Now I took the code I put up here, replaced delay with sleep and got an error saying sleep is an unknown identifier..????

weequ

2010-04-01 08:25:13

Just use delay :P