Hello, im using a program called Turbo Pascal and I was wandering if any of you know the answers to these questions:
1. Why is it best to write programs using both functions and procedures verses writing everything in the mainline?
2. Why do we use the Randomize statement in a program?
3. Where can you assign values to variables?
+ Reply to Thread
Results 1 to 4 of 4
-
-
1. because you can write a procedure only once and call it unlimited times from the MAIN program code
2. You would use randomize in many ways, one would be if you wanted a card game to give you a random card [i once wrote a SLBBS blackjack door game, for those who are familiar], or for instance i once wrote a dos based screensaver that randomly found points for fireworks explosions to appear on screen.
3. you define constants in the beginning of the main code or in a procedure. variables are assigned by either a 'readln' statement for a user response or as a definition statement in the code.
I am rusty at pascal, been 4-5 years since i have written a line of code to be honest, but since i was mostly self tought until i took some pascal classes in college i can tell you that reading source code of existing programs is the best way to learn, but i must admit in the days of DOS things were a bit simpler to just pick up. Hang in there, you'll get it.. BTW there are MANY books on teching yourself the language... C++ may be more useful in todays age though -
thanks for the info jasper!
<font size=-1>[ This Message was edited by: TDUBB on 2001-10-18 00:30:18 ]</font> -
Hey, jasperpso, wow I haven't heard "door game" in quite awhile. LOL. I didn't even think there was anyone that remembered what we use to do before the internet. LOL.
So would it work with wwiv, vbbs, wildcat, or all of the above?
LOL
have a great one,
TW
Similar Threads
-
C to Pascal
By vhelp in forum ProgrammingReplies: 1Last Post: 17th Apr 2011, 17:00 -
Windows XP Turbo 3D
By neworldman in forum ComputerReplies: 3Last Post: 21st Jul 2010, 18:20 -
turbo.264 issues
By marksch in forum MacReplies: 0Last Post: 9th Mar 2008, 19:46 -
turbo.264
By mhar4 in forum MacReplies: 4Last Post: 7th Sep 2007, 10:55 -
ffmpegx and Turbo.264
By Alric in forum ffmpegX general discussionReplies: 7Last Post: 25th Jul 2007, 22:30