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?
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?
Last edited by g0tp0t; 03-22-2010 at 03:18 AM. Reason: title change
Related, yes.
Same, no.
pascal and delphi are very similar, but i believe delphi is object based and pascal isnt
does that mean i can post here for help with pascal?
Or here.
Yes, just make sure you tell people what you are doing/in what language exactly.
ok, i am using free pascal and i am trying to make a small circle orbit around a point, this is my code:
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 apparentlyCode: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.
Last edited by g0tp0t; 03-22-2010 at 03:01 AM.
You have to sleep the thread.
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
is that an answer to my code or to my report? lol
Either way, i dont know how or what that means
Last edited by g0tp0t; 03-22-2010 at 03:28 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.
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
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..????
Last edited by g0tp0t; 03-22-2010 at 07:53 PM.
Just use delay :P
There are currently 1 users browsing this thread. (0 members and 1 guests)