CPS 1 - Spring, 1997 - Ramm 2/7/97 #10
Chapter 2. Text Manipulation and Algorithm Design
- More Looping Examples (Data Controlled Loops)
adder.pas
- Priming the loop
- The use of a Sentinel Value
- "Command Controlled" Loop
- command := '';
- while command <> 'q' do
- begin
- ...
- do the work
- ...
- writeln('Command?;');
- readln(command);
- end;
- The Editor Program
- Implement in slightly different order from text
- Implemented in Several Layers
- Main Loop and Exit Framework Only
editor1.pas
- Add Command Decode
editor2.pas
- Implement Individual Commands (some)
editor3.pas