Grr, still not working!
Heres the whole code. Suggestions welcomed.(i know im using Goto still but it hasnt failed me yet! ill find an alternative when i get better at pascal.)
program console;
uses classes,crt,dos,windows,SysUtils;
var
RootDir : Pathstr;
userfile,file1,file2 : Text;
records,command,usertext : String;
Label
1,CR;
BEGIN
ClrScr;
writeln('Please wait...');
writeln('Now Loading');
Delay(1000);
RootDir := Fsearch('C:\Hydraks\Console', GetEnv(''));
if RootDir = '' then
BEGIN
ClrScr;
writeln('Hydraks Console is not installed');
writeln('In order to use Hydraks Console, some files must be written to your hard drive');
writeln('Type "Install" on your keyboard and press Enter to install');
writeln('Type "Close" then press Enter to stop the program and not install');
Readln(command);
if command = 'Close' then Halt;
if command = 'Install' then
BEGIN
writeln('Now installing, Please wait....');
Delay(1000);
writeln('Creating directorys');
Delay(1000);
CreateDir('C:\Hydraks');
Delay(1000);
CreateDir('C:\Hydraks\Console');
Delay(1000);
CreateDir('C:\Hydraks\Docs');
Delay(1000);
writeln('Writing Files');
assign(file1, 'C:\Hydraks\Console\records.dat');
rewrite(file1);
writeln(file1, 'User input records:');
close(file1);
Delay(2000);
assign(file2, 'C:\Hydraks\Docs\About.txt');
rewrite(file2);
writeln(file2,'Hydraks is a series of mini programs created by Adam N.Andujar');
writeln(file2,'Current programs include;');
writeln(file2,'Hydraks Console');
close(file2);
delay(2000);
ClrScr;
writeln('Installation complete');
writeln('Press enter to continue');
readln;
Goto 1;
END
Else
BEGIN
writeln('ERROR! unknown command!');
writeln('Press enter to close the program.');
readln;
Halt;
END;
END;
if fileexists('C:\Hydraks\Console') then
BEGIN
1:ClrScr;
assignfile(file1, 'C:\Hydraks\console\records.dat');
writeln('Welcome to the Hydraks console');
writeln('Here you will be able to input a series of commands to get a series of options');
writeln('Input Help and Press enter to get a list of some commands');
readln(command);
append(file1);
writeln(file1,command);
closefile(file1);
if command = 'Help' then
BEGIN
writeln('The console works simply like this,');
writeln('in between "[]" is were your command goes');
writeln('What your commanding follows after');
writeln('eg [read]Records');
writeln('Whats in between the "[]" stays in lower caps');
writeln('What follows after starts with a capital letter');
writeln('Here is a list of some commands:');
writeln('[open]Records(Read things you have entered into the console)');
writeln('If the console tells you to put in a certain command in a certain way');
writeln('You have to enter it in that exact way then press enter');
writeln('Though you do not have to enter "" if it is in the command');
writeln('Input "Close" to close the program');
writeln('Input "Return" to go back');
readln(command);
if command = 'Return' then Goto 1;
if command = 'Close' then Halt;
END;
if command = '[Open]Records' then
BEGIN
ClrScr;
assignfile(file1, 'C:\Hydraks\console\records.dat');
reset(file1);
while not eof(file1) do
BEGIN
readln(file1,records);
writeln(records);
END;
closefile(file1);
writeln;
writeln('Input "Return" to go back');
writeln('Input "Clear" to clear your records');
readln(command);
if command = 'Return' then Goto 1;
if command = 'Clear' then
BEGIN
ClrScr;
assignfile(file1, 'C:\Hydraks\console\records.dat');
Erase(file1);
rewrite(file1);
writeln(file1,'User input records:');
closefile(file1);
writeln('Erased records, Press Enter to return');
readln;
Goto 1;
END;
END
Else
BEGIN
writeln('ERROR! Unknown command!');
writeln('Press enter to go back');
readln;
Goto 1;
END;
END;
END.