Here are a few rules you will have to respect when programming in TP7.
1) If you are using the graph.tpu unit ( uses graph; ) you will have to include the following procedure to your program:
procedure initgr;
var gd,gm : integer;
begin
gd:=detect;
initgraph(gd,gm,'c:\tp7\bgi');
end;
Don't forget to add the procedure intigr to your main procedure.
You will also have to add the statement closegraph in the main procedure.
See the section of the site called Graph Program for more details.
You will also have to check that the computer knows where to find the *.tpu files.
For that, you will have to go in the Options at the top of your screen.
You will then have to go into Directories.
Then type in the line where it says .exe and .tpu files: c:\tp7\units.
2) If you call a procedure make sure that its's defined above.
Example:
procedure nothing;
begin
end;
procedure something;
begin
nothing;
end;
In this example, the procedure nothing was defined before it was called in the procedure something.
The same thing works for functions.
3) If you want to include units into your program such as crt or graph, you will have to write the following line after the line where you give a name to your program ( usually the first one ).
uses nameofunit;
4) Your main procedure should always be at the end of the program.
5) To call a procedure or a function, you just have to type in the name of the procedure or function like this:
nameofprocedureorfunction;
6) To assign a value to something under the var ( see The basic structure of a TP7 program ), for example x is an integer, then you will have to write x:integer.
There is no equal sign.
7) To assign a value to something under the const ( see The basic structure of a TP7 program ) ,for example x is equal to 200, then you will have to write x=200.
There is no colon.