home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / vpascal.zip / MANUAL.2 < prev    next >
Text File  |  1985-11-13  |  52KB  |  1,598 lines

  1.  
  2.  
  3.  
  4.  
  5.                 CHAPTER 6: ADVANCED EDITING.
  6.  
  7.  
  8.  
  9.                 HELP menus:
  10.  
  11.  
  12. You can press ESC anytime to see a HELP screen that reviews the basic editing
  13. commands. You can also press F1 from the HELP screen or while editing to use
  14. the filing system menu to update a file, print parts of a file, switch to
  15. another file, or stop editing.
  16.  
  17.  
  18.  
  19.                 MOVING the CURSOR -- on the line:
  20.  
  21.  
  22.         left or right arrow   = move 1 character left or right;
  23.         End                   = move to end of this line;
  24.         Ctrl left/right arrow = move to start/end of line;
  25.         TAB, Shift-TAB        = move to next/prev. TAB position;
  26.         F2, Shift-F2          = move to next/previous word;
  27.  
  28.  
  29.                 MOVING the CURSOR -- up or down:
  30.  
  31.  
  32.         up or down arrow      = move 1 line up or down;
  33.         PGUP/PGDN             = move 20 lines up/down;
  34.         Ctrl-PGUP/PGDN        = move to start/end of file;
  35.         F4 + linenumber       = go to this line number in file;
  36.  
  37.  
  38. Hint: you can use either F4 CR or Ctrl-PGUP to go to the start of the file
  39. quickly.
  40.  
  41. Hint: also see SEARCHING for Text, another way to move around in the file.
  42.  
  43. Hint: the HOME key doesn't move the cursor in the file, but it places the line
  44. with the cursor near the middle of your screen. It is handy when you are
  45. entering text near the bottom of the screen and you want to look ahead a bit
  46. as you go.
  47.  
  48.  
  49.  
  50.                 SEARCHING for text:
  51.  
  52.  
  53. Searching starts with the character just after the cursor position. Press:
  54.  
  55.         F3
  56.  
  57. and enter the text you are looking for. Upper and lower case don't matter.
  58. Press CR to start the search.  The message 'Ctrl-F3= Replace' or 'Not Found!'
  59. will appear.  To search for another occurrence of the same word, just press:
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.         F3 CR.
  68.  
  69. Hint: to search for text starting from the beginning of the file, do this:
  70.  
  71.         F4 CR
  72.         F3 text CR
  73.  
  74. Hint: you can edit or move around in the file and later search again for the
  75. same word last searched with:
  76.  
  77.         F3 CR
  78.  
  79. Hint: you can leave a place marker in the file, such as zzzz; later, to return
  80. to this point, just search for it:
  81.  
  82.         F3 zzzz CR
  83.  
  84.  
  85.  
  86.                 Searching for and Replacing text:
  87.  
  88.  
  89. After searching for and finding some text, the message:
  90.  
  91.         Ctrl-F3 = Replace
  92.  
  93. is shown.  If you press Ctrl-F3, you will be asked what to replace the text
  94. that you found with:
  95.  
  96.         Replace with:_
  97.  
  98. You can type in whatever you want to replace the text you found.  When you
  99. press CR, the text is replaced, and you will be asked if you want to find
  100. another occurrence of the text you found. If you answer 'Y', and another
  101. occurrence is found, you will be asked if you want to replace this one also.
  102. You can continue to find and replace many occurrences of the same text by
  103. answering 'Y'; you can bypass and not change a particular occurrence of the
  104. text by answering 'N' to the question: 'Replace this one?', and you can stop
  105. searching for more occurrences by answering 'N' to the question: 'Find
  106. Another?'.
  107.  
  108.  
  109.  
  110.                 ENTERING text.
  111.  
  112.  
  113. TYPING inserts text, pushing the rest of the line over. You can move the
  114. cursor past the actual end of a line (which is shown by a shadow-box
  115. character). If you type out here, the line is automatically extended with
  116. spaces. You can enter text anywhere on the screen without worrying about the
  117. actual line length; the shadow-box is there just in case you want to know
  118. where the actual end of a line is (some printers might be limited in line
  119. width, for example).
  120.  
  121.  
  122. Hint: END and Ctrl-right-arrow always move to the actual end of line; if your
  123. cursor is past the end of line, it will move to the left in this case.
  124.  
  125. Hint: as described in THE BASICS, the editor capitalizes what you type
  126. automatically. But if you don't like this, just press F8 to toggle this
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. feature on or off.
  134.  
  135.  
  136. A NEW LINE is created by typing CR when the cursor is anywhere on a line. A
  137. new line is started below, with the same left margin as its upper neighbor.
  138.  
  139. SPLITTING a LINE is done by putting the cursor on the character which is to
  140. start the new (2nd) line, and pressing  Ctrl-CR.
  141.  
  142. JOINING 2 LINES is done by putting the cursor on the 1st of the 2 lines to
  143. join and pressing  Ctrl-BS.
  144.  
  145. INDENTING is controlled by F9 and F10.  F9(UNDENT) moves the margin of the
  146. current line left by 2 spaces; F10(INDENT) moves the margin right 2 spaces. It
  147. doesn't matter where the cursor is on the line when you use F9 or F10, so you
  148. can move down a program, re-formatting it line by line, quite easily.
  149.  
  150.  
  151.  
  152.                 DELETING text.
  153.  
  154.  
  155.         BS      deletes the character to the left of the cursor;
  156.         DEL     deletes the character at the cursor;
  157.         Ctrl-F2  deletes a word (if the cursor is on a word) or
  158.                   up to the next word (if not);
  159.         Ctrl-F4  deletes the rest of the current line;
  160.  
  161. Note that F9 (UNDENT) deletes leading spaces, and Ctrl-BS deletes the line
  162. separator characters.
  163.  
  164. Deleting entire lines and blocks of lines is done with the cut and paste
  165. commands.
  166.  
  167.  
  168.  
  169.                 CUT (Delete lines) and CUT & PASTE (Move lines).
  170.  
  171.  
  172. As described in the BASICS chapter, you use:
  173.  
  174.         F5      to start or end marking text, and move it to the
  175.                 copy buffer;
  176.         F6      to cut (delete) the block you have just marked;
  177.         F7      to paste (copy) the text from the buffer to the
  178.                 current location of the cursor.
  179.  
  180.  
  181. Hint: the last text you put into the buffer stays there until you quit the
  182. editor, so you can switch files and copy the text into the new one.
  183.  
  184. Warning: Each time you mark text, it becomes the only text in the copy buffer.
  185. So if you are going to move text around, be sure to copy it into the program
  186. BEFORE marking the next block of text (because the new block will over-write
  187. the old block in the buffer).
  188.  
  189. Hint: in re-arranging text in a program, you can store pieces of text at the
  190. end of the program, and later move them to a final location.
  191.  
  192. Hint: you can print the text that is in the buffer with the filing system (see
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. below).
  200.  
  201.  
  202.  
  203.                 THE FILING SYSTEM.
  204.  
  205.  
  206. F1 brings the filing menu to the screen. The filing system allows you to
  207. switch files, make backup copies of a program, print text, and quit the
  208. editor, with the most common actions carried out by pressing CR.  The commands
  209. available are:
  210.  
  211.         R       to REPLACE (update) a file and RUN it;
  212.         Q       to QUIT the editor;
  213.         B       to BACKUP a file, using any name and any disk
  214.                  drive;
  215.         S       to SWITCH to another file;
  216.         P       to PRINT marked text on the printer.
  217.  
  218. REPLACE means to update the same disk file you started editing with the
  219. changes you made in the current editing session, and then compile and run the
  220. same program.
  221.  
  222. QUIT means stop editing and leave the editor.  If you have changed your file
  223. at all since loading it, you will be asked if you are sure you want to quit.
  224.  
  225. BACKUP prompts you for the file name to write the edit file to.  You can
  226. specify any legal DOS filename, including a drive prefix, and even a full
  227. pathname if you want. Afterwards, you stay in the editor, so you can use this
  228. command to write an extra copy of your file to another disk, as a backup.
  229.  
  230. You can also select S for SWITCH FILES. The current file will be updated if it
  231. has been modified, and you will be prompted for a new file name. Type the new
  232. name and CR, and edit the new file. Note that the copy buffer is still intact,
  233. so you can move blocks of text between files this way.
  234.  
  235. The 2nd time you select SWITCH FILES, the last file you edited will be the
  236. default(suggested) file name, so you can switch between 2 files repeatedly
  237. without entering their names more than once.  This makes it easy to build a
  238. new file from parts taken from other files. The editor keeps track of the line
  239. you were on in each file.
  240.  
  241. Finally, you can select P for PRINT BUFFER to send the contents of the copy
  242. buffer (the marked text) to the printer. Use this to print out portions of a
  243. program for proofreading, etc.
  244.  
  245.  
  246. Note: File names may include drives and extensions, like
  247.  
  248.         a:myfile.txt
  249.  
  250. and may include sub-directory pathnames if you are using them. (If you are not
  251. sure what these are, you aren't using them and don't worry about it!)
  252.  
  253.  
  254.  
  255.  
  256.                 ERROR MESSAGES AND PROMPTS.
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265. On the lowest screen line, to the right of 'Press ESC for HELP', is an area
  266. used for messages to help you with some commands or warn you of errors that
  267. have occurred.
  268.  
  269.  
  270. First, an explanation of the serious errors:
  271.  
  272.  
  273. WHAT FILE??        -- the file name you have typed is not a valid PC-DOS file
  274. name; check your spelling and try again.
  275.  
  276. FILE TOO LARGE!    -- if you try to edit a file that is too large for the
  277. editor or your computer's memory, the edit is cancelled after this message. If
  278. you edit a file containing TAB characters, the editor converts these to spaces
  279. and the file could possibly grow too large during this conversion, with the
  280. same result.
  281.  
  282. TOO MANY LINES!    -- if you try to edit a file with over 3000 lines, the edit
  283. is cancelled with this message.
  284.  
  285. DISK ERROR!!       -- this message occurs when attempting to update a file if
  286. the drive's door is open, or the disk has too little room on it for the file,
  287. or no room in its directory. An additional message is also given to indicate
  288. what you should do. Generally, you must fix the problem (switch disks, etc)
  289. and try again.  When you get this error, you have not updated your disk file
  290. yet! Try to do it before quitting the editor, or you will lose the editing you
  291. have been doing.
  292.  
  293. CHECK PRINTER!     -- this means that your printer is off, or off-line, or
  294. otherwise not properly connected or functioning. Fix the problem and re-try
  295. the print command.
  296.  
  297. LINE TOO LONG!     -- this means that you have tried to make a line longer
  298. than 250 characters; the editor can't do this, and you probably didn't want to
  299. do it either!
  300.  
  301. Del. all lines?    -- this message is given if you try to delete the entire
  302. file with the cut command (F6). The editor assumes that you don't want to do
  303. this.
  304.  
  305. Block too large.   -- given if you try to mark too large a block of text for
  306. your copy buffer. This can only happen with computers that have 128K of memory
  307. or less.
  308.  
  309.  
  310. Messages that are less serious and more for guidance are:
  311.  
  312.  
  313. Low on memory!     -- you are within 1000 characters of the maximum file size
  314. you can edit.
  315.  
  316. NEW FILE!          -- the file with the name you typed was not found on the
  317. disk, so the editor assumes you will type in text for a new file of that name.
  318. Of course, you might have misspelled the file name, so the editor beeps (in
  319. case you are not looking!).
  320.  
  321. Converting tabs.   -- the editor found TAB characters in your file and is
  322. expanding them into spaces at intervals of 8 columns.
  323.  
  324. LONG lines split   -- the file you are editing had lines longer than 250
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331. characters in it, and these lines have been split. This editor is not intended
  332. for editing files, such as word processor output, with lines this long,
  333. although in a pinch you can split the lines up as you like with Ctrl-CR.
  334.  
  335. Writing...         -- the editor is writing a file to disk after an UPDATE
  336. command was given.
  337.  
  338. Written.           -- the UPDATE operation is complete.
  339.  
  340. Autocaps is on.
  341. Autocaps is off.   -- these tell state of the auto-capitalization feature.
  342.  
  343. Scrolling right.   -- the screen is moving right, following the cursor, and
  344. the left-most screen column is no longer column 1 of your file. To return to
  345. the left-most 'standard' position, you can use Ctrl-left arrow or ESC-ESC.
  346.  
  347. Printing...        -- printing of the copy buffer is in progress.
  348.  
  349. Searching...       -- a search command is in progress.
  350.  
  351. Ctrl-F3 = Replace   -- a search has found what you wanted; you may, if you
  352. like, replace it with text you specify by pressing Ctrl-F3 and following the
  353. prompts.
  354.  
  355. Not found!         -- a search did not find what you wanted. Note that the
  356. search command starts just after the current cursor position, so you may need
  357. to return to the beginning of the file before searching to find every
  358. occurrence of the text you want.
  359.  
  360. Marking...         -- you pressed F5 once. Move the cursor to mark the text
  361. you want, then press F5 again.
  362.  
  363. Text in buffer.    -- you pressed F5 again, and the text you marked has been
  364. copied into the copy buffer. The word TEXT appears on the next-to-last screen
  365. line as a reminder.
  366.  
  367. Text deleted.      -- you pressed F6 and the marked text has been removed.
  368.  
  369. goto marked text   -- you pressed F6 but the cursor was not in the marked
  370. text. You can only delete text while the cursor is in the block, so move the
  371. cursor into it and try again.
  372.  
  373. mark text first    -- you pressed F6 but either you had not marked some text
  374. first OR you have done some line-editing since marking the lines. The editor
  375. only allows you to delete text BEFORE adding or deleting lines anywhere in the
  376. file.
  377.  
  378. No text to copy.   -- you pressed F7 but there is nothing in the copy buffer
  379. to copy into the file.
  380.  
  381. Text copied.       -- you pressed F7 and text was copied from the copy buffer
  382. into the file.
  383.  
  384.  
  385.  
  386.  
  387.                 TECHNICAL SPECS FOR THE EDITOR
  388.  
  389.  
  390. The editor will run on computers which are compatible with the IBM-PC to the
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397. extent of having the same screen memory addresses. This includes all IBM
  398. models plus most 'close' compatibles. Dos 2.0 or later is required. BIOS
  399. functions are used for cursor and screen mode control; MS-DOS functions are
  400. used for keyboard input and all disk and printer I/O. 40 column screens can be
  401. used as well as 80. Full Dos 2.0 pathnames can be used for the edited files.
  402.  
  403. Files to be edited must use CR,LF pairs to separate lines. TAB characters in
  404. the file will be expanded to spaces; no other characters will be converted,
  405. and 'strange' characters in the file will be displayed in the standard IBM
  406. character set. Only characters from 32 to 126 ASCII can be entered into files.
  407. The maximum line length is 250 characters; longer lines are broken when the
  408. file is loaded if necessary. There is an absolute limit of 3000 lines per
  409. file.
  410.  
  411. The editor makes use of what memory is available in the computer to create an
  412. edit buffer and a copy buffer. In a 128K machine, the edit buffer will be
  413. about 60,000 characters, and the copy buffer will be about 10,000. In a larger
  414. machine, the copy buffer will expand to 60,000 characters. In a 64K machine,
  415. both the edit and copy buffers will be small, about 5000 characters.
  416.  
  417. The editor is named VISED.EXE as distributed; a batch file EDIT.BAT is used to
  418. edit VISIBLE-PASCAL files and controls the filing system command to compile
  419. and Run the program. The batch file places a '/' after the program file name:
  420.  
  421.         VISED demofile/
  422.  
  423. and this enables the Replace and Run filing option.
  424.  
  425. When used with the companion compiler, the editor will locate errors in the
  426. source file automatically. This is done by entering the edit file with '/e'
  427. after the filename:
  428.  
  429.         VISED demofile/e
  430.  
  431. The editor then inspects BIOS RAM locations for information concerning the
  432. line, column, and number of the error that occurred. An error file named
  433. ERR.TXT is opened, if present, and the correct error message is read form it
  434. and displayed right below the portion of the source file where the error
  435. occurred.
  436.  
  437. However it is entered, using the 'R' command exits the editor with an exitcode
  438. of 1, which can be read by a .BAT file to decide what to do next. Since the
  439. exitcode from the 'Q' exit command is 0, the file RUN.BAT which controls the
  440. system ends if the exitcode is 0, and starts the compile and run process if
  441. the exitcode is 1.
  442.  
  443.  
  444.  
  445.  
  446.                 SUMMARY OF CURSOR MOTION COMMANDS
  447.  
  448.  
  449.         cursor-arrow-keys       move 1 character up, down, left,
  450. right;
  451.         Ctrl-left-arrow         go to start of line;
  452.         Ctrl-right-arrow                go to end of line;
  453.         End                     go to end of line;
  454.         PgUp, PgDn              move up or down 20 lines;
  455.         Ctrl-PgUp, Ctrl-PgDn    go to start, end of file;
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.                 SUMMARY OF EDITING KEY COMMANDS
  465.  
  466.  
  467.         Esc                     look at help menu;
  468.         Home                    place the current line near the
  469.                                  screen center;
  470.         Del                     delete the character over the
  471.                                  cursor;
  472.         BS (backspace)          delete the character to left of
  473.                                  cursor;
  474.         CR                      start a new line below the
  475.                                  current one;
  476.         Ctrl-CR                 split the line at the cursor
  477.                                  location;
  478.         Ctrl-BS                 join the current line with the
  479.                                  next one.
  480.  
  481.  
  482.                 SUMMARY OF FUNCTION KEY OPERATIONS
  483.  
  484.  
  485.         F1                      go to filing system to update,
  486.                                  run, quit, switch files, or
  487.                                  print parts of a file;
  488.         F2                      move right one word;
  489.         Shift-F2                move left one word;
  490.         Ctrl-F2                 delete a word or delete up to
  491.                                  next word;
  492.         F3 ____                 search for text and optionally
  493.                                  replace it;
  494.         Ctrl-F3                 replace text (after finding it
  495.                                  with F3);
  496.         F4 ____                 go to line ____.  F4 CR = go to
  497.                                  line 1;
  498.         Ctrl-F4                 delete from the cursor to the end
  499.                                  of line;
  500.         F5                      mark the start or end of a block
  501.                                  of text;
  502.         F6                      delete the marked block of text;
  503.         F7                      copy last block marked to the
  504.                                  cursor location;
  505.         F8                      toggle auto-capitalization on or
  506.                                  off;
  507.         F9                      move the margin left two spaces;
  508.         F10                     move the margin right two spaces.
  509.  
  510.  
  511.                 SUMMARY OF FILING SYSTEM COMMANDS
  512.  
  513.  
  514.         R (after EDIT file)     Replace a Visible-Pascal file and
  515.                                  Run it;
  516.         R (after VISED file)    Replace file and quit editing;
  517.         Q                       Quit editing;
  518.         B                       Backup to a file with any drive
  519.                                  and name;
  520.         S                       Switch to another file;
  521.         P                       Print the marked text on the
  522.                                  printer.
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.                 CHAPTER 7: RUNNING VISIBLE-PASCAL PROGRAMS
  600.  
  601.  
  602.  
  603. To RUN a program you use the part of the Visible-Pascal system called the
  604. DEBUGGER -- it helps you find and fix program bugs, or errors.  You use it by
  605. issuing the command  'RUN myfile'  or by using  'EDIT myfile'  and selecting
  606. 'R' from the editor's filing system menu.  The debugger allows you to watch
  607. the operation of the program as it runs, to see whether it does what you want
  608. it to. The debugger allows you to step through a program, one statement at a
  609. time, while watching the program listing to see what statement is being
  610. executed, and what the values of program variables are. It also allows you to
  611. control how fast the program runs and when it should stop, and allows you to
  612. look at the output of the program (if it writes or draws on the screen) as
  613. well as the information made available by the debugger. Using it is automatic;
  614. the Visible-Pascal compiler creates program files which, when 'fed into' the
  615. debugger, automatically make the 'connections' required for all the above to
  616. happen.
  617.  
  618.  
  619. Chapters 2 and 3 tells how to run a program using the debugger. Using these
  620. quick introductions, try running a program or two to get the feel of how it
  621. operates, and experiment with some of the commands. Then read this chapter,
  622. which will describe each of the functions of the debugger in full.
  623.  
  624.  
  625.                 The Program and Debugger screens
  626.  
  627. When a program runs it often uses the computer screen to write text or draw
  628. graphics. You will want to watch this output as the program runs, to see what
  629. it is doing.  However, there is other information about a program which can be
  630. useful, including a listing of the statements as they execute,  the values of
  631. program variables, etc. which can also help tell you what your program is
  632. doing. The program output and the debugger's information about the program
  633. would both ideally have separate screens for display.  However, since you
  634. probably only have one computer display, Visible-Pascal manages the
  635. information coming from the program and the debugger so that you can watch
  636. whichever one you want. A command to switch screens is used to view either the
  637. program or the debugger output, and Visible-Pascal makes sure that 1) the
  638. debugger information is always accurate, and 2) the program output is always
  639. accurate and complete, with nothing lost during the times that you are
  640. watching the debugger screen. In this way, the two kinds of information can be
  641. viewed as separate windows on the computer screen. Pressing 'S' is the command
  642. to switch to the other screen.
  643.  
  644.  
  645.                 Looking at the values of variables
  646.  
  647. The debugger screen shows a copy (or LISTING) of your program, and looks a lot
  648. like the screen looks when you are editing, except for a window at the bottom
  649. with summaries of the debugger commands, and some information which is
  650. inserted into the listing.  The most important of this is the value of all
  651. program variables, which is placed between angle brackets on the same line
  652. with any variable declaration, like this:
  653.  
  654.         YOUR_NAME : STRING;    <<Harrold>>
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.         COUNT     : INTEGER;    <<15>>
  662.  
  663. The variable COUNT has the value 15 at the moment, and YOUR_NAME is Harrold.
  664. All variables except arrays have their current values right in the listing
  665. like this. Local variables also have values if the procedure in which they are
  666. declared is being executed. To see the values of variables that are 'off
  667. screen', you can use the editing commands (such as PgUp, etc) to look around
  668. in the listing. The Home key returns you to the line which is next to execute.
  669.  
  670. The debugger will try to place the variable values at the end of the line with
  671. the declaration; if the line is very long, they will be crowded to the right
  672. and may overwrite part of your program line. Leave more space (by putting
  673. comments on a separate line) if you want to improve the appearance of the
  674. program listing in the debugger.
  675.  
  676.  
  677.                 Controlling program execution
  678.  
  679. There are several ways to use the debugger to control the execution of your
  680. program.  One way is to press 'R' for RUN: you will see the program run at
  681. full speed, with the program output on the screen.  This is essentially like
  682. running without the debugger, except that you can always stop the program and
  683. return to the debugger to look at variables or single step, etc. To stop a
  684. program that is running, just press Ctrl-Break. The program will be stopped
  685. and the debugger screen shown. You can switch screens between the program and
  686. debugger output with the 'S' key, or do any other command (to be discussed
  687. soon).
  688.  
  689.  
  690.  
  691.                 The Debugger Commands
  692.  
  693.  
  694.         R = RUN until BREAK or Checkpoint.
  695.  
  696. The RUN command always puts the program output on the screen and starts the
  697. program running at full speed. It continues until one of four things happen:
  698.  
  699.         1. You press Ctrl-Break;
  700.         2. The checkpoint line is reached;
  701.         3. An error occurs while the program is running;
  702.         4. The program finishes normally.
  703.  
  704. Except for the last case, the result is the same: the program is stopped, the
  705. debugger is brought to the screen, and you can continue with any available
  706. command.  The checkpoint line is a line you have selected for the program to
  707. stop at; it is discussed below under 'set checkpoint'. If the program stops
  708. because of an error, you will be told the reason, and can look around in the
  709. program to inspect variables; but the program cannot be re-started from the
  710. point of the error. You must re-run it from the beginning.
  711.  
  712.  
  713.         <space> = do 1 line.
  714.  
  715. Pressing the space bar causes the program to execute one statement and stop.
  716. This is often called 'single stepping' a program, and lets you follow what it
  717. does as slowly as you like. You can inspect variables at any time. If you have
  718. some doubt about what your program is doing, single stepping will show you the
  719. sorry truth! If you have lots of time, it is the only debugging command you
  720. need; other commands are actually time-savers, allowing you to mix some
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727. full-speed execution with single stepping.
  728.  
  729. You can single step with either the debugger on the screen (to see the lines
  730. of the program as they execute) or with the program output on the screen. You
  731. can switch screens (with the 'S' command) to the screen you want, then single
  732. step with <space>. Switch screens any time you like.
  733.  
  734. If you single step at a line with a READ or READLN statement, then if the
  735. debugger is showing, you will be clearly told that the program is asking for
  736. input, and you will be prompted to type it in. Single step the program WORDS
  737. to see this in action. If the program output is on the screen, then your
  738. program should prompt you for some input, and as you press <space>, you will
  739. see the cursor move to the right for each space. This is the time to type in
  740. the information your program is expecting.  Try this with the WORDS program,
  741. too.
  742.  
  743.  
  744.         N = Next line down.
  745.  
  746. The Next line command is a short-cut. If you are stepping through some
  747. statements and you don't want to follow a procedure call statement into a new
  748. procedure, but want to go to the next line in the procedure you are in, then
  749. press 'N' instead of <space>.  'N' will also complete statements like:
  750.  
  751.         FOR COUNT := 1 TO 5 DO WRITELN('something');
  752.  
  753. in one operation, whereas <space> would stop once for each time the WRITELN is
  754. executed.  Therefore, use 'N' to go to the Next program line after the current
  755. one, no matter what the current line is.
  756.  
  757.  
  758.         W = watch the program execute slowly.
  759.  
  760. Watching a program means to execute each statement at a rate of about 1
  761. statement per second, showing you the result on either the debugger or the
  762. program screen.  It is good for either automatically showing you the progress
  763. of the program, or just to run a program in super-slo-mo. You can stop the
  764. program anytime with Ctrl-Break, as always.
  765.  
  766.  
  767.         S = Switch to/from program screen.
  768.  
  769. 'S' switches between the debugger screen and the program output screen. It is
  770. a good habit to form to switch screens as a program runs, so you can see what
  771. it is producing. When you are watching the debugger, all the output from the
  772. program is captured and saved until you switch to the program screen; then all
  773. the saved output is sent to the screen rapidly. It is possible to save more
  774. information than will fit in memory, in which case some program output will be
  775. lost. This won't happen if you occasionally switch screens as you debug the
  776. program (and in any event, you usually have room for several screens full of
  777. output in the buffer).
  778.  
  779.  
  780.         Ins = set, Del = clear the checkpoint.
  781.  
  782. You can set a checkpoint on a program line, which will cause the program to
  783. stop and return to the debugger screen when that line is executed. It is used
  784. when you want the program to execute at full speed up to a point which you
  785. want to examine in greater detail (by single stepping, etc). To do this, just
  786. use the cursor keys (up and down arrow, PgUp/PgDn, etc) to move the brackets
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793. < >  in the left margin of the listing to the line where you want the program
  794. to stop. Then press Ins to insert the checkpoint there. A '!' will appear
  795. inside the brackets:  <!>.  There is only one checkpoint at a time, so any
  796. previous one set will be cleared.  If you want to clear the checkpoint without
  797. setting one, press Del at any time.  After setting a checkpoint, you can
  798. return to the current line by pressing Home. Now if you RUN  or WATCH the
  799. program, it will stop at the checkpoint line.  Of course, if the program never
  800. executes the line with the checkpoint, then it won't stop there!
  801.  
  802. Hint: If you put a checkpoint on the last line in the listing, the program
  803. will stop after it is done, allowing you to check the final program screen and
  804. any interesting program variables.
  805.  
  806.  
  807.         Cursor control keys.
  808.  
  809. To look around in the program and read the listing, or to inspect variables,
  810. or to insert a checkpoint, you can use the cursor control keys that cause up
  811. and down motion: up and down arrow, PgUp, PgDn, Ctrl-PgUp, Ctrl-PgDn, and
  812. Home. They have the same meaning as in the editor, except that Home returns
  813. you to the current line that is ready to execute. The left and right motion
  814. keys don't do anything; if a long program line is partly off screen right,
  815. there is no way to read the rest of it while in the debugger (although you can
  816. return to the editor to do so).  If the program is very large, the longer
  817. lines in the listing may be abbreviated to save memory for the program.
  818.  
  819.  
  820.         Q = Quit, E = Edit : leaving the debugger.
  821.  
  822. If your program executes correctly and completely, it will end and the
  823. debugger will exit, like any program would. But you can stop the debugger in
  824. two other ways: 'Q' just stops, so you can do something else, or perhaps
  825. re-run the program from the beginning;  and 'E' goes directly to the editor,
  826. and in fact directly to the line you are on, so you can fix the program and
  827. re-run it. During the development of a program, you will find it convenient to
  828. run, trace, or step the program until an error becomes apparent, then use 'E'
  829. to exit directly to the editor, fix the error, and then select 'R' = RUN from
  830. the filing system menu in the editor to re-run the program.  You can repeat
  831. the edit & run process quickly and easily until your program is perfect!
  832.  
  833.  
  834.  
  835.  
  836.                 SUMMARY OF DEBUGGER COMMANDS
  837.  
  838.  
  839.         R               Run program until <Break> or checkpoint;
  840.         <space>         Run 1 statement and stop;
  841.         N               run to the Next lower line and stop;
  842.         W               Watch the program run slowly;
  843.         S               Switch between debugger and program
  844.                          screen;
  845.         Ins,Del         Insert and Delete the checkpoint;
  846.         E               go directly to the Editor;
  847.         Q               Quit the debugger, return to DOS;
  848.         up/down arrow
  849.         PgUp/PgDn
  850.         Ctrl-PgUp/PgDn  look around in listing; move < > for
  851.                          setting the checkpoint <!>.
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.                 CHAPTER 8: VISIBLE-PASCAL SYNTAX
  864.  
  865.  
  866.  
  867. This chapter is to help you understand the limitations and special features of
  868. Visible-Pascal; it isn't a complete Pascal manual or study course.
  869. Visible-Pascal is a special version of Pascal, with the purpose of giving the
  870. first-time Pascal programmer an easy time writing and programming his or her
  871. first programs. Therefore, an easy editor, fast and automatic program
  872. execution and running, and a full symbolic debugger with the program operation
  873. and variable values easily visible have been supplied at the expense of other
  874. possible programming features.  For example, Visible-Pascal is not a complete
  875. implementation of Pascal; it does not generate programs that run as fast as
  876. possible; and it does not include such advanced features as low level machine
  877. access and modular program construction and linking. It is an adequate
  878. language to allow the writing of interesting and significant programs,
  879. however.  Disk files can be read and written; strings are included; and the
  880. various screen modes possible on the IBM-PC can be used, including the drawing
  881. of graphics in color. All these features are fully supported by the debugger.
  882. This chapter will describe some of the significant features of Visible-Pascal;
  883. the supplied demonstration programs also have useful examples of various
  884. features.
  885.  
  886.  
  887.  
  888.  
  889.                 Pascal Language Features Included & Excluded
  890.  
  891.  
  892. Visible-Pascal includes the following data types:
  893.  
  894.         INTEGER         1, 32000, -55
  895.         BOOLEAN         TRUE, FALSE
  896.         CHAR            'a', CHR(65)
  897.         STRING          'this is a string'
  898.         Enumerated     (MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY)
  899.         TEXT files with integer, boolean, character, or string
  900. components
  901.  
  902. Missing is the real data type. Variables can be both global and local; types
  903. can be declared in a TYPE section, and used in variable declarations or in
  904. parameter lists.
  905.  
  906. Single-dimensioned arrays with positive indexes are included:
  907.  
  908.         ARRAY[1..10] OF INTEGER
  909.         ARRAY[1..100] OF CHAR
  910.         ARRAY[1..1000] OF BOOLEAN
  911.  
  912. Four text files are pre-declared:
  913.  
  914.         INPUT   = standard keyboard input, redirectable
  915.         OUTPUT  = standard screen output, also redirectable
  916.         CON     = screen output, not redirectable
  917.         PRN     = printer output
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925. Re-entrant use of procedure and functions is OK, but they cannot be declared
  926. FORWARD nor are local procedures allowed. Full parameter passing is allowed,
  927. by value or by address (VAR - parameters).
  928.  
  929. These Pascal control statement types are included:
  930.  
  931.         IF...THEN...
  932.         IF...THEN...ELSE...
  933.         REPEAT...UNTIL...
  934.         WHILE...DO...
  935.         FOR...TO/DOWNTO...DO...
  936.         CASE...OF......END
  937.  
  938. But the GOTO statement is specifically excluded, as encouraging bad habits!
  939.  
  940. Set constants are included, so you can write:
  941.  
  942.         IF X IN ['A'..'Z'] THEN...
  943.  
  944. but set variables are not included.
  945.  
  946. Records, pointers, and dynamic memory allocation are not included.
  947.  
  948. The following string procedures and functions are built-in:
  949.  
  950.         CHR(int)                returns character value of int
  951.         ORD(ch)                 returns integer value of char. ch
  952.         LENGTH(str):INTEGER     returns the length of str
  953.         POS(str1,str2):INTEGER  returns the position of str2 in
  954.                                  str1
  955.         CONCAT(str1,str2)       concatenates str2 to str1
  956.         COPY(str1,str2,pos,cnt) copies str2[pos]..str2[pos+cnt]
  957.                                  to str1
  958.         DELETE(str,pos,num)     deletes num chars at str[pos]
  959.         INSERT(str1,pos,str2)   inserts str2 at str1[pos]
  960.  
  961. All strings have a maximum length of 80 characters, and a dynamic length of 0
  962. to 80 which is stored as element 0. Thus, to set the length of S, do:
  963.  
  964.         S[0] := CHR(LEN);       if LEN is the length to set S to.
  965.  
  966.  
  967. The following additional routines can be used for direct keyboard input:
  968.  
  969.         KEYPRESSED:BOOLEAN      is true if a key was pressed and
  970.                                  its value is waiting in the
  971.                                  keyboard buffer
  972.         INKEY:CHAR              function returning the next key
  973.                                  from keyboard.
  974.                                 Returns keys immediately, without
  975.                                  waiting for
  976.                                 CR; also returns extended
  977.                                  (double) codes for function keys
  978.                                  and other special cases.
  979.  
  980. The following routines are supplied to control the screen:
  981.  
  982.         CLS                     clears the screen, homes the
  983.                                  cursor
  984.         CURSOR(X,Y)             sets cursor position. upper left
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.                                  = 0,0
  992.         SETMODE(M)              sets screen mode to one of the
  993.                                  following:
  994.                                 0 = black&white, 40 columns;
  995.                                 1 = color,       40 columns;
  996.                                 2 = black&white, 80 columns;
  997.                                 3 = color,       80 columns;
  998.                                 4 = 320x200 color graphics
  999.                                 5 = 320x200 black&white graphics
  1000.                                 6 = 640x200 black&white graphics
  1001.                                 7 = monochrome display adapter
  1002.         TEXTTYPE(T)             sets all characters following to
  1003.                                  attribute:
  1004.                                 0 = normal white on black;
  1005.                                 1 = bold intensity
  1006.                                 4 = underlined (monochrome
  1007.                                     adapter only)
  1008.                                 5 = blinking
  1009.                                 7 = reverse video
  1010.                                 8 = invisible
  1011.         TEXTCOLOR(C)            sets following characters to
  1012.                                  color:
  1013.                                 0 = black
  1014.                                 1 = blue
  1015.                                 2 = green
  1016.                                 3 = cyan
  1017.                                 4 = red
  1018.                                 5 = magenta
  1019.                                 6 = yellow
  1020.                                 7 = white
  1021.         TEXTBACKGR(C)           sets the background color as
  1022.                                  above
  1023.         BORDER(C)               sets the border color to colors
  1024.                                  0..7, or
  1025.                                 to colors 8..15 which are light
  1026.                                  versions
  1027.         PALETTE(X)              Graphics only, selects palette 0
  1028.                                  or 1
  1029.         BACKGROUND(X)           graphics only, selects color
  1030.                                  0..15 as background
  1031.  
  1032. This routine is supplied for sound production:
  1033.  
  1034.         TONE(NOTE,DURATION)     makes a NOTE of DURATION msec.
  1035.                                 NOTE is 1..15.
  1036.  
  1037. This routine is supplied to draw graphics on the screen:
  1038.  
  1039.         DRAW(X1,Y1,X2,Y2,COLOR) draws a line from x1,y1 to x2,y2
  1040.                                 in COLOR
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.                 An Outline of a Visible-Pascal Program
  1061.  
  1062.  
  1063. The following model program will show some of the basic structural parts of a
  1064. Visible-Pascal program.
  1065.  
  1066.  
  1067. PROGRAM DEMO;           {no program parameters are needed}
  1068.  
  1069. CONST                   (* this is an alternative comment form *)
  1070.   INTCONST = 1;
  1071.   BOOLCONST = TRUE;
  1072.   CHARCONST = 'x';
  1073.   CHARCONST2 = "y";     {either ' or " can be used for quotes}
  1074.   STRINGCONST = 'this is a string constant';
  1075.  
  1076. TYPE
  1077.   ATYPE = ARRAY[1..100] OF INTEGER;     {only positive indexes}
  1078.  
  1079. VAR
  1080.   A,B,C : INTEGER;      {you can do multiple definitions, but}
  1081.   D     : ATYPE;                {it's not neat}
  1082.   S1    : STRING;
  1083.   F1    : TEXT;         {the file type declaration}
  1084.  
  1085.  
  1086. PROCEDURE COUNTEMUP(INVAL:INTEGER;
  1087.                     VAR OUT:INTEGER);
  1088. {note value parameter for input and VAR parameter for output}
  1089. VAR             {note local variable with same name as global}
  1090.   D : BOOLEAN;
  1091. BEGIN
  1092.   D := INVAL > 6;
  1093.   IF D THEN OUT := 12 ELSE OUT := INVAL;
  1094. END;
  1095.  
  1096. FUNCTION ANOTHER:INTEGER;       {a function returning an integer}
  1097. BEGIN
  1098.   ANOTHER := ORD(INKEY);        {built-in proc., gives next key}
  1099. END;                            { from keyboard (a char) }
  1100.  
  1101.  
  1102. BEGIN                   {this is the start of the program itself}
  1103.   A := 1;
  1104.   B := 2;
  1105.   COUNTEMUP(A+B, C);    {note expression for the value parameter}
  1106.   WRITELN(C);
  1107.   A := ANOTHER;
  1108.   COUNTEMUP(A+C, C);
  1109.   WRITELN(C);
  1110.   WRITELN('all done now');
  1111.   WRITELN("that's all, folks!");        {note use of  '  or "  }
  1112. END.
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.                 Syntax of Visible-Pascal
  1124.  
  1125.  
  1126. Identifiers in Visible-Pascal consist of the normal alphanumeric characters,
  1127. plus the underline character _ which is legal inside identifiers for improved
  1128. readability. Identifiers can be any length, but must differ from other
  1129. identifiers in the program in the first 10 characters. Numbers are normal
  1130. decimal numbers or hexadecimal numbers which are formed by using the dollar
  1131. sign as a prefix:  $F000 for example.  Comments are formed by pairs of braces
  1132. {...}  or these alternates:  (* ... *).  You can put one kind of comment
  1133. around text that includes the other kind.  String quotes can be put in either
  1134. single or double quotes (' or "), and the alternate type of quote can be
  1135. included in the string (see the last statement of the example above). The
  1136. editor automatically capitalizes characters typed except when they are within
  1137. single or double quotes or comment braces. Note that the alternate comment
  1138. form (* ... *) does not affect capitalization; for neat programs, use the {
  1139. ... } form for normal comments, and the alternate form to 'comment out' a
  1140. procedure or region of the program temporarily.
  1141.  
  1142. A Visible-Pascal program consists of a PROGRAM statement, a declarations
  1143. section which consists of any number of CONST, TYPE, and VAR sections,
  1144. followed by any number of PROCEDUREs or FUNCTIONs, followed by the main
  1145. program part: a BEGIN ... END block, finally ended with a period. There are no
  1146. compiler directives, pseudo-comments, or other complications.
  1147.  
  1148. A PROCEDURE or FUNCTION consists of the heading, including an optional
  1149. parameter list, and, in the case of a function, a return type, followed by a
  1150. declarations section and a BEGIN ... END block finally ended with a semicolon.
  1151. Procedures cannot be nested inside other procedures. Function return values
  1152. must be simple types: INTEGER, CHAR, BOOLEAN, or enumerated, but not arrays,
  1153. strings, or files.  See the demonstration programs for examples of various
  1154. procedures and functions.
  1155.  
  1156.  
  1157. Statements follow the syntax of standard Pascal closely.  The CASE statement
  1158. also allows ranges of case labels to be expressed just like a set:
  1159.  
  1160.         CASE X OF
  1161.         1..5: STATEMENT1;
  1162.         6..10: STATEMENT2;
  1163.         END;
  1164.  
  1165. and their is no OTHERWISE clause in the case statement, as in some Pascals.
  1166. You should test for legal values of the case selector before the case
  1167. statement, unless you wish the run-time error trapping to report it for you!
  1168.  
  1169.  
  1170. Arrays are restricted to a single dimension, and thus an array of STRING is
  1171. not possible. In addition, the array index cannot be negative; all arrays
  1172. start with element 0 and go up to the maximum you declare (the minimum array
  1173. bounds that you specify is ignored).
  1174.  
  1175.  
  1176. There is no GOTO statement, since it encourages bad habits!
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.                 RESERVED AND PREDECLARED WORDS IN VISIBLE-PASCAL
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191. The following words are keywords in the language, and must not be re-declared
  1192. by the programmer.
  1193.  
  1194. AND     ARRAY   BEGIN   BOOLEAN CASE    CHAR    CHR     CONST
  1195. DO      DOWNTO  ELSE    END     FOR     FUNCTION        GOTO
  1196. IF      IN      INTEGER MOD     NOT     OF      OR      ORD
  1197. PRED    PROCEDURE       READ    READLN  REPEAT  STRING  SUCC
  1198. TEXT    THEN    TO      TYPE    UNTIL   VAR     WHILE   WRITE
  1199. WRITELN
  1200.  
  1201.  
  1202. There are two predeclared constants: TRUE, and FALSE.
  1203.  
  1204.  
  1205. There are four predeclared files: INPUT, OUTPUT, CON, PRN.
  1206.  
  1207.  
  1208. The following are built-in functions:
  1209.  
  1210. EOF     EOLN    ODD     KEYPRESSED      INKEY   LENGTH  POS
  1211. CHR     ORD     PRED    SUCC
  1212.  
  1213.  
  1214. The following are built-in procedures:
  1215.  
  1216. ASSIGN  RESET   REWRITE CLOSE   CLS     CURSOR  DRAW    TONE
  1217. CONCAT  COPY    DELETE  INSERT  SETMODE TEXTTYPE        TEXTCOLOR
  1218. TEXTBACKGR      BORDER  PALETTE BACKGROUND
  1219.  
  1220.  
  1221. Operators are:
  1222.  
  1223. +       -       *       /       MOD
  1224. AND     OR      NOT     IN
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                 CHAPTER 9: TECHNICAL DETAILS AND INSTALLATION
  1259.  
  1260.  
  1261. Visible-Pascal consists of three major programs: VISED, VISBUG, and VISPAS,
  1262. which do the editing, debugging, and compiling functions of the Visible-Pascal
  1263. system. They are fairly small disk files (20-25K), but need considerable
  1264. memory for internal buffers and so require computers with 128K total memory.
  1265.  
  1266. Visible-Pascal is actually run using some batch (.BAT) files to control the
  1267. sequence of execution of the three major parts. For example, the EDIT command
  1268. executes the EDIT.BAT command file, which executes the editor, and then
  1269. depending on a return code which the editor gives back to the operating system
  1270. either executes the RUN batch file or simply stops.  The EDIT.BAT file is:
  1271.  
  1272. echo off                (this prevents display of the commands)
  1273. cls                     (clears the screen)
  1274. vised %1/               (edits the file, with / added to command          line
  1275. if errorlevel 1 run %1  (Run the program if return = 1, else
  1276. quit)
  1277.  
  1278. The command to use to edit a non-Visible-Pascal file, such as this
  1279. documentation, is simply:
  1280.  
  1281.         VISED manual.1
  1282.  
  1283. this uses the editor directly.
  1284.  
  1285. The RUN.BAT file also uses return codes to control execution. The following
  1286. notes will help to understand it.
  1287.  
  1288. -VISPAS uses standard input and output for the source and code (.COM)
  1289. files;
  1290. -VISPAS returns errorlevel 5 if a fatal error occurred (such as
  1291.  program too long), and errorlevel 1 if a syntax error was
  1292.  found;
  1293. -VISBUG, the debugger, returns errorlevel 1 if the editor is
  1294.  requested, and 0 to just quit;
  1295. -If Vised is entered with /e on command line, a syntax error will
  1296.  be displayed as the first edit screen.
  1297. -After a succesful compilation, a .COM file is left on the disk,
  1298.  and the program can be executed without the debugger's aids; for
  1299.  example, to execute WORDS directly, type:
  1300.  
  1301.         WORDS <CR>
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.                 INSTALLATION
  1327.  
  1328.  
  1329. Programs generated by Visible-Pascal use standard DOS operations for input and
  1330. output in all cases except graphics drawing, changing screen modes, and making
  1331. sound. To do standard DOS I/O, a program called ANSI.SYS which is supplied
  1332. with DOS must be used when the computer is started or reset. The steps
  1333. required to do this are:
  1334.  
  1335.         1. Remember to start the computer with a DOS 2.0 or later
  1336. disk;
  1337.         2. This disk must have the file ANSI.SYS on it;
  1338.         3. This disk must also have a file called CONFIG.SYS on
  1339. it;
  1340.         4. CONFIG.SYS must have the line:
  1341.                 DEVICE=ANSI.SYS
  1342.            included in it (it can have other lines if your system
  1343.            requires).
  1344.  
  1345. If all the Visible-Pascal files on are this boot disk, then the supplied
  1346. AUTOEXEC.BAT file will cause the execution of the batch file G.BAT which will
  1347. give a sign on message to Visible-Pascal and a directory display, after which
  1348. you are off and running.  A separate disk can be used for Visible-Pascal; just
  1349. insert it in the default drive and type G.
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.                 CHAPTER 10: DEMONSTRATION PROGRAMS
  1392.  
  1393.  
  1394. SOUNDS          -the first program to try
  1395. WORDS           -another introductory program
  1396. TURTLE          -a simple program to draw on the screen
  1397. PRETTY2         -a prettyprinter (neatens your programs)
  1398. BOX             -draws boxes
  1399. SOUNDS2         -a program that makes noise
  1400. PATTERN         -controls cursor position and text attributes
  1401. COLOR           -allows you to set screen mode and text color
  1402. STRINGS         -shows the use of the INSERT string procedure
  1403. FILEDEMO        -writes, then reads a disk file
  1404. INKEY           -shows how to read keys, including function keys
  1405. TESTCASE        -brief program to test CASE error trapping
  1406. LISTER          -creates a listing with line numbers
  1407. WEATHER         -uses boolean function to answer questions
  1408. MATH            -a trivial 4-function calculator
  1409. KEYDFINE        -program to re-define any key on keyboard
  1410.         etc.(there may be more, soon)
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.                 CHAPTER 11: PRETTY-PRINTING
  1458.  
  1459.  
  1460. Sometimes your program has lost its nicely indented appearance, due to a lot
  1461. of editing changes, and while it is easy to use the indent and undent commands
  1462. in the editor to fix it up, there is a program supplied with Visible-Pascal
  1463. that does this for you, if you prefer.  PRETTY1 is a program which reads a
  1464. file, which should be a valid Pascal program, and creates another file which
  1465. has been neatly indented and auto-capitalized. To use it to neaten up a file
  1466. called 'myfile', you would do:
  1467.  
  1468.         PRETTY1  <myfile  >newfile
  1469.  
  1470. The arrows are the commands for using standard input and output under DOS 2.0.
  1471. Done this way, a file called 'newfile' will be created and will be the
  1472. neatened version of 'myfile', which is not changed by the process. If you
  1473. want, you can then copy newfile to myfile and then erase newfile. Note that
  1474. using standard output can be useful; you could, for example, do:
  1475.  
  1476.         PRETTY1 <myfile >prn
  1477.  
  1478. in which case the neatened file goes directly to the printer.  Do not,
  1479. however, make the input file and the output file the same! Dust will fly if
  1480. you do...
  1481.  
  1482. PRETTY2 is the text of a program which can be RUN by Visible-Pascal. You can
  1483. customize this program if you want a different format for your programs. The
  1484. use of standard input and output is not compatible with stepping the program
  1485. with the debugger, so at the first debugger menu, Quit; then type:
  1486.  
  1487.         PRETTY2 <myfile >newfile
  1488.  
  1489. to run the program without the debugger.  If you just type
  1490.  
  1491.         PRETTY2
  1492.  
  1493. you will have to type in the program, line by line; as you do so, each line
  1494. will be re-typed with the correct indenting on the screen.  Type F6 CR to send
  1495. and end-of-file to the program.
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.                 CHAPTER 12: KEYBOARD RE-DEFINITION
  1524.  
  1525.  
  1526. If you don't like the way certain keys are used, in the Visible-Pascal editor
  1527. or in many other programs, you can fix things to your liking with programs
  1528. like KEYDFINE, a demonstration program which re-defines the Ctrl-A key to mean
  1529. ' := '  , a key sequence you use a lot in Pascal. The IBM technical manual has
  1530. a chapter on using extended screen and keyboard control, which gives some
  1531. hints on how to do this. For now, RUN KEYDFINE; press 'R' at the debugger
  1532. menu. Now try pressing Ctrl-A and see what prints on the screen.
  1533.  
  1534. You can define any key to be any sequence of characters or other keys, and you
  1535. could make a second program that reversed, or undid, the actions of the first,
  1536. allowing you to re-define keys when using one program, but not changing the
  1537. key definitions permanently.
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589. -----------------------------------------------------------------------------
  1590.  
  1591. This disk copy provided by   THE PUBLIC (Software) LIBRARY
  1592.                                      P.O. BOX 61565
  1593.                                     HOUSTON, TX 77208
  1594.  
  1595. Send self-addressed envelope with two stamps for the latest library listing
  1596. and monthly public domain software newsletter.
  1597.  
  1598.