This is an exercise from THE ELEMENTS OF PROGRAMMING STYLE by Kernighan and Plauger. The program supposedly counts characters, words and sentences. A slach signals end of data. The exercise is to replace the arithmetic ifs with logical iffs.
I don't think the program works, arithmetic ifs or...
I've been trying to install Free Pascal on my PC. The download seems to have gone OK. There is now a directory called FCP with a subdirectory named 2.2.0. What next? Isn't the program itself supposed to be FCP.EXE? This file does not exist. Do I need to do some more unzipping? There are...
In the last 24 hours I have had TPC crash whenever I use it on my XP machine. I.e., I type TPC myprog and the Command Prompt window immediately disappears.
The problem seems to be connected with certain sources files, i.e., files with .pas as the extension. However, compiling unaffected files...
I want to create an array of records and have it be a typed constant, I've tried the following:
Type
ElementType = record
Noun : String ;
AtomNum : Byte ;
AtomMass : Real
end ;
Const
ATOM_TABLE : Array [0 .. 2] of ElementType =
(...
I'm using the command line compiler of Turbo Pascal 7. I do not have the IDE.
I recall there is a method of running the compiler and having it tell you which line of code has a run-tme error. It is some kind of switch that tells the compiler the address of the error. It's something like...
Is there any way to delete a record in a typed file? For example:
type
whatype = file of string ;
var
f : whatype ;
i : longint ;
begin
i := 99 ;
assign (f, 'whatever') ;
reset (f) ;
delete (f,i) ;
close (f)
end.
In the above code delete (var f:whatype ; i:longint)...
Suppose I write a program and sell copies of the .exe file. How can I keep one customer from making a copy of the .exe file and giving it away? (or selling it? I don't want to use a dongle.
I have bought software that required a code to install but I have no idea how to implement such a...
I have an old PC with Windows 98. The HD is 8.4 Gig with four partitions of 2.1 Gig each. Only the C: partition has anything on it. There are no files on the machine that I want to keep.
I want to make this a DOS 6.22 machine. I had planed to repartition the drive with fdisk, but it occurs...
thread935-969152
First, it would not compile because the variable pocMedz is never declared.
Second, assuming that was fixed, the program simply clears the screen, then waits for the user to hit a key.
The Boolean expression in the IF statement will never evaluate to TRUE ergo the write...
BACKGROUND
DOS provides for redirection of input/output. A program designed to accept input from the keyboard and output to the screen can be made to accept input from a file and/or output to another file. For example, the following program is written for std in to std out.
Program fCopy...
I'd like to program my iMac using Pascal. There seems to be four possibilities.
1. Turbo Pascal for Mac. I think Borland offered such a thing at one time. I keep browsing eBay for a copy. Can I download it?
2. Think Pascal. I have a link for a download but the site seems to no longer...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.