03.03.2013 Views

DIGITAL RESEARCH(r) CP/M Plus TM (CP/M Version 3) Operating ...

DIGITAL RESEARCH(r) CP/M Plus TM (CP/M Version 3) Operating ...

DIGITAL RESEARCH(r) CP/M Plus TM (CP/M Version 3) Operating ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6.3 ED Operation <strong>CP</strong>/M 3 User's Guide<br />

The W (Write) Command<br />

The W command writes lines from the buffer to the new file. The W command<br />

takes the form:<br />

nW<br />

where n is the number of lines to be written from the beginning of the buffer to the<br />

end of the new file. If n is greater than 0, ED writes n lines from the beginning of<br />

the buffer to the end of the new file. If n is 0, ED writes lines until the buffer is half<br />

empty. The OW command is a convenient way of making room in the memory buffer<br />

for more lines from the source file. If the buffer is full, you can use the OW command<br />

to write half the contents of the memory buffer to the new file. You can use the #W<br />

command to write the entire contents of the buffer to the new file. Then you can use<br />

the OA command to read in more lines from the source file.<br />

Note: after a W command is executed, you must enter the H command to reedit<br />

the saved lines during the current editing session.<br />

The E (Exit) Command<br />

An E command performs a normal exit from ED. The E command takes the form:<br />

E<br />

followed by a carriage return.<br />

When you enter an E command, ED first writes all data lines from the buffer and<br />

the original source file to the $$$ file. If a BAK file exists, ED deletes it, then renames<br />

the original file with the BAK filetype. Finally, ED renames the $$$ file from filename.$$$<br />

to the original filetype and returns control to the operating system.<br />

The operation of the E command makes it unwise to edit a back-up file. When vou<br />

edit a BAK file and exit with an E command, ED erases your original file because it<br />

has a BAK filetype. To avoid this, always rename a back-up file to some other filetype<br />

before editing it with ED.<br />

Note: any command that terminates an ED session must be the only command on<br />

the line.<br />

6-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!