Even if the code would compile, it certainly is not gonna do what you want.
Take a look at this:
repeat
readln(body);
until(body = '[save]File');
Lets say the user types the following: (<Enter> means the user presses Enter)
This is a really cool program.<Enter>
And I got it for free!<Enter>
[save]File<Enter>
What dou you think the value of body now actually is?
Later on you do this:
Rewrite(Ufile);
writeln(body);
closefile(Ufile);
You probably want it to write the value of body to the file UFile.
Instead it is always gonna write the string '[save]File' to the screen.
if fileexists('C:\Xhydriks\Console\',Fname,'.',Ftype) then
begin
writeln('File already exists!');
writeln('Type something else');
readln(Fname);
end
This piece of code does actually nothing relevant at all.
The user is aksed to re-type the name of the file, but nothing is done with that information. (not to mention the fact that if you would use this information, you did not check if the user enterd the same name again, or the name of some other already existing file).
Some C&C
- You are a beginning programmer. That's not a problem here. Many of us (including me) started out like you, stumbling in the dark.
However you seem to be trying to program a real text editor into your program. This is way to complicated a task for a beginner. - Do not pester the users with pointless delays
- Try to read up on the basics of programming. How to control the flow of the program. How to structure the code. Data structures.
- Try to make some kind of "flow-chart" of what the program actually is supposed to do (use plain old pen and paper for this). Break it down into individual tasks that need to be done. If you can draw it this way, you already have the main algorithm of the program, and it will be much easier to translate it into code.
- Start with simple things, then gradually tackle some more complicated problems
We really do not mind helping the totally unexperienced starters, but we expect you to put in some effort as well.
Happy programming.
Bart