It's not just happened with this Pascal program either, I few I have done and then wanted to add "clrscr" or some colour, I can't as when I add CRT, it causes spacing/formatting problems. Writeln(f2,'Mean Petrol Consumption = ',totaldist/totalfuel:10:2) Īs soon as I add "uses crt " that's when I get problems. Writeln('Mean Petrol Consumption = ',totaldist/totalfuel:10:2) Writeln(f2,'Total Gallons = ',totalfuel:10:2) Writeln('Total Gallons = ',totalfuel:10:2) To include a library in the program, one should use the reserved word ' uses ', because it is used to call a library of functions and procedures. ![]() Writeln(f2,vnumber,#9,(dist/volfuel):15:2) These functions belong to a library (or 'unit' as it is called in Pascal) called CRT and thus this would require your program to include the library 'crt.tpu'. ![]() Z:='Vehicle No.'+#9+'Fuel Consumption (MPG)' Here is the code: program fuel(input, output) The code compiles fine, but then some text is out of place and symbols appear where they shouldn't. I want to use the CRT unit in some Pascal code, just for the "clrscr" function but it's causing issues.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |