View Full Version : Are pascal and delphi the same thing?
g0tp0t
03-22-2010, 02:28 AM
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
03-22-2010, 02:29 AM
Related, yes.
Same, no.
x[Warrior]x3500
03-22-2010, 02:29 AM
pascal and delphi are very similar, but i believe delphi is object based and pascal isnt
g0tp0t
03-22-2010, 02:41 AM
does that mean i can post here for help with pascal?
i luffs yeww
03-22-2010, 02:43 AM
Or here (http://villavu.com/forum/forumdisplay.php?f=77).
Wanted
03-22-2010, 02:43 AM
Yes, just make sure you tell people what you are doing/in what language exactly.
g0tp0t
03-22-2010, 02:49 AM
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
03-22-2010, 04:54 AM
You have to sleep the thread.
g0tp0t
03-22-2010, 03:19 PM
is that an answer to my code or to my report? lol
Either way, i dont know how or what that means:tongue:
Nava2
03-22-2010, 03:47 PM
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
03-22-2010, 03:58 PM
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
04-01-2010, 12:25 PM
Just use delay :P
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.