PTE Features not found in the Manual ------------------------------------ 1. Workbench support Loading from workbench ICON Command 2. Printer support PRINT Command SET PRINTER filename SET PRINTER EOL 'eol string' SET PRINTER FORMFEED 'formfeed string' 3. Saving files for other systems SET EOL 'eol string' 4. Default Search Path 5. New Functions [PRINT MARK] [TOGGLE FLAG] [IF MARK FILE] [CLEAR COMMAND] 6. PTE character font 1. Workbench Support 1.1 Loading PTE from Workbench The manual describes how to start PTE from CLI but not from workbench. There are several ways to invoke PTE from Workbench: open the PTE icon, open an icon whose default tool is PTE. If you select several project icons (using the left shift key) then the selected files will be loaded if they have FILETYPE=text as one of their TOOL TYPES (accessible through info option in the workbench menu). PTE also understands two other TOOL TYPES: MACRODEF=filename, and MICRODEF=filename. MACRODEF=filename specifies what definition file to load into the editor. Only the first MACRODEF file is used. It is assumed to set up the menus, mouse buttons, and the key definitions to be used for the editing session. MICRODEF=filename specifies what definition file defines the aspects of this file type. For example, what default margins or tabs to use, what icon to use for saving this file type. This definition will only be loaded if the STATE file for this file was not loaded. If the state file is loaded then it will contain all this information and it is not necessary to execute the MICRODEF file. The order of processing is as follows: If the FILETYPE is not equal to text then don't accept this file. Otherwise, 1. load the file for editing 2. if no other MACRODEFs were loaded then load this file's MACRODEF file. 3. if the file's STATE file was not found, then load this file's MICRODEF file. The above steps are repeated for all the selected files. If no MACRODEF files were specified/found/loaded then PTE will attempt to load PTE.Def file. Note that PROJECT icons that automatically call up PTE can be found in the PTE/Icons directory on the distribution disk. 1. Workbench Support 1.2 ICON Command To create an icon for the current file being edited, execute the ICON command. It has the following format: I(CON) filename where: filename = name of the file that contains icon information. Note that the icon information is actually stored in a file of filename.info. The .info extension is assumed and should not be given by you. You may create an icon by using the CLI copy command, the advantage of using the ICON command in PTE is that PTE lets Workbench pick a suitable initial spot for the icon, and the COPY command will cause the new ICON to be places on top of the existing icon. 2. Printer support The manual states that you cannot print files from within the editor. This is not true. To print a file from within the editor you should use the PRINT command. PTE has several printer related commands and functions, they are described below. 2.1 The PRINT command has the format P(RINT) where: filename = name of file or device which is to receive the printout. If none is specified then the name set with the SET PRINTER command is used. To change the name of the default printer device use: SET PR(INTER) filename where: filename = name of file or device which is to receive the printout. The default name is 'PRT:' which is the amiga printer device. (you may use PAR: or SER: if you want to send raw ascii codes to your printer.) Every line that is sent to the printer is followed by the end of line string, which by default consists of a carriage return/line feed. (ASCII codes 13, and 10) To change this default use: SET PR(INTER) E(OL) 'eol string' maximum length for the string is 80 characters. At the end of every printout, PTE sends a formfeed string to the printer. The default for the formfeed string is a formfeed character (ASCII code 12). To change the default issue: SET PRINTER FORMFEED 'formfeed string' maximum length for the string is 80 characters. If you do not wish to formfeed between printouts, then set this string to null (''). 2.2 Printer Functions A printer function is available to facilitate printing of parts of files. The command is [print mark], and will print the lines touched by a mark. Note that if the file containing the mark is not the current file, then it will become the current file. By changing the default printer name, it is possible to write marked blocks to a file. For example, to write a marked block to file My.Text, the following can be used in a key definition: def c-f1 = [execute] 'set printer My.Text' * change default name def c-f1 + [print mark] * save the block def c-f1 + [execute] 'set printer PRT:' * change back the default 3. Saving files for other systems If you are preparing a file that is to be sent to another computer, it may be necessary to change the end of line character(s) that are used. For example an MS-DOS machine expects a CR/LF combination to end all lines, while on the Amiga it is just LF. So if you send amiga files to you PC, you will not be able to read them via the TYPE command. To change the end of line string that is appended to the end of every line during a save or file operation use: SET EOL 'eol string' maximum string length is 80 characters. Note that PTE still expects to see a CR or LF at the end of every line when loading a file. If you are loading a file that has a CR/LF ending the line, then you will have a double spaced file. To delete all the extra blank lines issue the following command on the command line or assign it to a key: ex [do][if blank line][delete line][down][else][next blank line][end if][loop] def c-f2 = [do] def c-f2 + [if blank line] def c-f2 + [delete line] def c-f2 + [down] def c-f2 + [else] def c-f2 + [next blank line] def c-f2 + [end if] def c-f2 + [loop] This will delete only the EXTRA blank lines, not all blank lines. 4. Default search path The default search path is not just the current directory as stated in the manual. Unless changed with the SET PATH command the search path is as follows: current directory :PTE directory on the current volume :PTE/Defs directory on the current volume PTEDefs: directory Note that it is possible to place the default PTE.Def file any where as long as PTEDefs: is ASSIGNed the directory that contains PTE.Def. If you are configuring your system keep in mind that the icon info files refer to PTEDir:, which is the directory containing all PTE related files, and PTEDefs: which is the directory expected to hold definition files. The PTE distribution disk sets the PTEDefs: to sys:PTE/Defs, and PTEDir: to sys:PTE at boot time so if you boot with the PTE distribution disk you won't go wrong. 5. New Functions The following functions have not been documented in the manual. [PRINT MARK] described in section 2.2 above. [TOGGLE FLAG #] toggle the state of flag # [IF MARK FILE] The condition is met if the current file contains a mark, or if there is no mark in any of the files. [CLEAR COMMAND] clear all text from the command line. 6. PTEFont Character Font PTE will attempt to load a disk based character font by the name of PTEFont from the current font directory when it is first loaded. If the font is not found then the Topaz font will be used. The PTEFont is identical to the Topaz font except it has unique graphic representation for characters 0..31, and 128..159. Topaz font displays these characters as a box. The PTEFont has codes 128..159 and some of the 0..31 codes are defined as line drawing characters, all of the help files assume that the font has been loaded. If your help files contain a lot of tiny box characters then you should either copy PTEFont.font file and PTEFont directory to your fonts: directory, or reboot with the PTE distribution disk. The file Docs/LineChars contains a listing of the characters and their codes.