Functions are just like procedures, but functions return a value. The values passed between the main program and the function must be the same data type. We have already used a function called UpperCase(). It took a string and returned the string with uppercase letters. Syntax: func...
(less)
As your programs become more advanced, placing all the code in the main program can make the program more difficult to code. Slicing the program into sections can help. These sections are called by many names. The names include: subs, sub-modules, sub-procedures, and procedures. In pascal, these...
(less)
Arrays hold lists of variables of the same data type. When there are large lists of variables and data, it is easier to contain the data in an array than have large amounts of separate variables to hold the data. Think of an array as a placeholder for piece of data.The syntax of the array is:Nam...
(less)
Loops are useful for having the computer repeat commands over and over. There are three types of loops for Free Pascal. The loops include the while loop, repeat until and the for loop. There must be a condition met to end the loop. If the condition is not met the computer will go into a infinite...
(less)
At this point in the tutorial series, we can start putting programs together from the previous tutorials.We will use the classic game Guess My Number. It is a very boring game to play, by today’s standards, but programing the game can be interesting.These are the requirements of the game:T...
(less)
Multi-Dimensional Arrays are two or more arrays that are combined into one. Some examples of a situation where a multi-dimensional array might be used would be a chess board, grid, or a deck of cards. For this tutorial we will create a multi-dimensional array for a deck of cards. In a deck of ca...
(less)
This tutorial will cover data types. The data types that are most common are the integer, real (floating point), string, char, and boolean. There are several other data types that are built into Free Pascal. The list is found in the documentation on Free Pascal’s Website (www.freepascal.org). Th...
(less)
Because Voice4Me is designed to work on as many devices as possible. SchoolFreeware left customizing the resolution, of the pictures, up to the user. Having pictures with large resolutions my cause Voice4Me to run slowly on older computers. If the pictures resolution is too small when running on ...
(less)
The final portion of the drawing segment of this tutorial series involves moving some drawings around with the keyboard. This segment will cover key-presses, loops, constants and if statements.The following program will draw a circle on the screen, and when the user presses “A” the c...
(less)
Because Voice4Me is designed to work on as many devices as possible. SchoolFreeware left customizing the resolution, of the pictures, up to the user. Having pictures with large resolutions my cause Voice4Me to run slowly on older computers. If the pictures resolution is too small when running on ...
(less)
Case statements are much easer to program, work with, and understand than If statements. This tutorial will cover creating a case staement. All code can be downloaded at SchoolFreeware.com
(less)
Drawing with QBasic is very simple and fun. This tutorial covers drawing using loops. There are some neat patterns that can be made using drawing and loops with QBasic. This tutorial will use Screen 13. All code, and diagrams can be downloaded at www.SchoolFreeware.com
(less)