====== PCBEdit ====== PCBEdit is a utility which you can use to edit text files. Support for PCBoard's @X color codes and @ macros is directly integrated into PCBEdit. ===== Starting PCBEdit ===== There are several command line parameters or options you can specify when loading PCBEdit. These parameters will control how PCBEdit will behave. If you are not yet familiar with PCBEdit, skip the sections that discuss command line parameters. The PCBEdit command line uses the following format: PCBEDIT /parameter /parameter ... /parameter [filename] The following section describes the valid command line parameters for PCBEdit. ==== Command Line Parameters ==== === /ATMAC:[@macro@]:[replacement text] === When a PCBoard @ macro is displayed in PCBEdit, default text is displayed in their place. To change the text that is displayed for each @ macro, use this command line parameter. After the colon, specify the @ macro you want to change the default text followed by a colon and the next text to be displayed. Example usage: PCBEDIT "/ATMAC:@USER@:JIM SMITH" **NOTE:** Quotes must surround any parameter which contains a space. If no quotes are used, the command line parameters will be mis-interpreted. === /COLOR === Forces PCBEdit to use a color display adapter card even if a monochrome card was detected. === /LLEND:[ASCII code(s)] === Specifies a different character sequence to be appended to the last line when a file is saved. By default, the last line is written with a carriage return / line feed appended to it. With this switch, you can change it to several carriage return/line feed pairs, an end of file character, etc. Replace [ASCII code(s)] with any valid ASCII codes. Example usage: PCBEDIT /LLEND:013,010,013,010 === /MACRO:[filename] === Loads the macro filename specified by [filename]. Example usage: PCBEDIT /MACRO:C:\PCB\PCBEDIT.MAC === /MONO === Forces PCBEdit to use a monochrome display adapter card even if a color display is detected. === /NOAT === Forces PCBEdit to not interpret @ macros or @X codes (regardless of whether or not /ATX is in effect). This setting is useful for using PCBEdit as a text editor. === /NOATX === Forces PCBEdit to ignore @X codes and to display all text in the attribute specified via the /STARTATTR option. === /NOBAK === Forces PCBEdit to not keep backup files. === /NOBUZZ === Disables the buzzing sound for alerting the user about error conditions. === /NODOS === Forces PCBEdit to not allow shells to DOS. === /NOIO === Disables the ALT-I, ALT-K and ALT-L functions. Also disables the ability to specify the filename to save in the ALT-S function. === /NOQUICK === Displays the welcome screen when PCBEdit starts. === /NOSS === Tells PCBEdit to not strip trailing spaces from lines. === /SET:[filename] === Loads the file specified by [filename] as the function key character set (available by pressing ALT-F in PCBEdit). Example usage: PCBEDIT /SET:C:\PCB\PCBEDIT,KEY === /SNOW === Tells PCBEdit to test for CGA screen snow. === /SS === Tells PCBEdit to strip trailing spaces from lines. === /STATUS:[type] === Changes the default status bar type to the type specified: |**0**|detailed status bar with code ribbon (Default)| |**1**|function key status bar with code ribbon| |**2**|no status bar or code ribbon| === /STRIPG === Always strip the G graphics file specification (if present) prior to attempting a file load. === /TRYNOG === Strip the G graphics file specification (if present) if a file with the G as part of the filename doesn't exist. === REM [/option] === Removes the command line parameter from processing (works with any parameter which begins with a forward slash [/]. ==== Specifying Command Line Parameters ==== There are three ways of specifying startup options. The first is on the PCBEdit command line. For example: PCBEDIT /NOQUICK /MACRO:MAIN.MAC /SET:MAIN.SET NEWSG The second means of specifying startup options is through the PCBEDIT environment variable, which you can SET in your AUTOEXEC.BAT file. An example line would look like this: SET PCBEDIT=/QUICK "/ATMAC:@USER@:SCOTT ROBISON" Finally, startup options may be specified in a configuration file. It is named PCBEDIT.CFG and can be located in the same directory as PCBEDIT.EXE or in the current directory. It can be created with any text editor, may have as many lines as necessary, and may have several options on one line, as long as all lines are limited to 127 characters or less. Here's an example: "/ATMAC:@USER@:FIRST LAST" /NOBAK /MACRO:C:\PCB\PCBEDIT.MAC /STATUS:1 PCBEdit searches for startup options in the following order: - PCBEDIT.CFG (first in the directory with PCBEdit, then in the current directory) - PCBEDIT environment variable - PCBEDIT command line. In this way, an option in the PCBEDIT.EXE directory configuration file can be overridden by another option later in the same file, in the other configuration file, environment variable or command line. **NOTE:** Parameters specified on the command line always override any prior settings. ===== PCBEdit Macros ===== Fifteen sets of user-defined macros are supported by PCBEdit. Each set consists of ten strings that may be accessed via the F1 - F10 function keys. Different sets may be accessed by utilizing the SHIFT-ALT-F1 - SHIFT-ALT-F10 keys for sets 1 - 10 and the SHIFT-CTRL-1 - SHIFT-CTRL-5 keys for sets 11 - 15. The macros may be selected from and maintained with the ALT-G key. Each macro may consist of whatever text the user would like. Additionally, the following special sequences are recognized by PCBEdit: |**\X**|Stuffs the character following backslash in the keyboard buffer (\\ to stuff a literal backslash)| |**\**|By itself at the end of a macro with nothing following it will stuff a literal backslash in the keyboard buffer| |**~X**|Stuffs the lowercase letter X in the keyboard buffer| |**~#**|Stuffs the code for function key F# in the keyboard buffer| |**~**|By itself at the end of a macro with nothing following it will stuff a literal tilde in the keyboard buffer| |**#X**|Stuffs the uppercase letter X in the keyboard buffer| |**##**|Stuffs the code for function key Shift-F# in the keyboard buffer| |**#**|By itself at the end of a macro with nothing following it will stuff a literal pound sign in the keyboard buffer| |**^X**|Stuffs a CTRL-X in the keyboard buffer| |**^#**|Stuffs the code for function key control F# in the keyboard buffer| |**^**|By itself at the end of a macro with nothing following it will stuff a literal carat in the keyboard buffer| |**!X**|Stuffs an ALT-X in the keyboard buffer| |**!#**|Stuffs the code for function key alt F# in the keyboard buffer| |**!**|By itself at the end of a macro with nothing following it will stuff a literal exclamation point in the keyboard buffer| ===== Using PCBEdit ===== PCBEdit is not meant to replace screen-design programs such as TheDraw. These programs are still incredibly useful for screen design. PCBEdit is designed to allow you to write what we call information intensive display files (such as NEWS and BLT files), as opposed to display intensive files (such as WELCOME and BRDM.) PCBEDIT.EXE will exists in the same directory where you installed PCBoard. In fact, if you installed a brand new PCBoard, you will notice the default editor defined in System Manager | Define Text & Graphics Editors is PCBEdit. Because it deals with PCBoard's @X codes and @ macros, it can be used to design all files, eliminating the need for separate graphics display files. To load PCBEdit, type the following at the DOS prompt: PCBEDIT If you already know the filename you want to edit, specify it on the command line when you load PCBEdit. The following illustrates how to edit C:\PCB\GEN\NEWS: PCBEDIT C:\PCB\GEN\NEWS When PCBEdit is loaded, you will see the following screen: This is the screen where you will do all of the editing. For a brief description and list of keyboard commands that are available in PCBEdit. A brief summary of the most commonly used keyboard commands follows: |**ALT-A**|Change the current color attribute. Use this to insert a color at the current cursor position.| |**ALT-L**|Load a file into the editor. Only one file can be loaded at a time.| |**ALT-S**|Save the current file to disk.| |**ALT-X**|Exit PCBEdit.| |**PgDn**|View the next 23 lines in the file.| |**PgUp**|View the previous 23 lines in the file.| |**Up**|Move the cursor up one row.| |**Down**|Move the cursor down one row.| |**Left**|Move the cursor to the left.| |**Right**|Move the cursor to the right.| ===== Answers To Common Questions ===== === PCBEdit saves files with a carriage return/line feed after the last line, but I need an end of file character after the last line. Is there a way to accomplish this? === There are a couple of ways to do this. One is to position yourself at the end of the last line just before saving it and hit CTRL-Z or ALT-026 (on the numeric keypad). Another option, if you want it to save that way every time you save the file, is to use the /LLEND option to change the last line ending sequence of characters. /LLEND:26 will save an end of file marker after the last line instead of a CR-LF. === When I change background colors and type spaces all the way to the end of the line it displays as expected. But sometimes if I move the cursor off of that line (and always after a save and reload of the same file) the background color no longer appears across the entire line. What happened? === The effect you desire is automatic when using screen oriented editors (such as TheDraw and PCBDraw) because they save the entire screen (80X25), and that's why you can only edit that size of display with those programs. Since PCBEdit functions more as a text editor instead of a screen editor, it attempts to optimize the output of the file before saving by stripping trailing spaces before writing the file to disk. This is easily avoided by including a color change at the end of the line back to the original background color. For example, to include a blue bar on a line (with nothing else) on a line, type the following: @X00@X1F @XFF Since the @XFF appears after the spaces, the spaces are treated as significant and are saved with the file. Since the @XFF only performs a color change, nothing textual is displayed after the spaces, giving you the desired effect. Additionally, if you wish to have the color change affect the rest of the current line you could use an @CLREOL@ macro to change the color of the line. === I prefer the status bar format from TheDraw and PCBDraw. Is there any way to implement this?=== You can use the ALT-T key to toggle status line types between the default one, one that appears more like the TheDraw/PCBDraw status line, or no status line at all. Or you can use the /STATUS configuration option to select which one you want by default === If I mark a block to change the color or delete, it also removes the color codes and non-displayable macros to the left and right of the block. Why does this happen and is there a way around it? === There are three block types: block, line and character. Line and character are straight forward; they mark a range from the beginning to the end and everything in-between. A true block (any rectangular region) is different though. In PCBoard display files, one physical character in the document does not necessarily equal one displayable character. For example, @QON@ does absolutely nothing to the display, but instructs PCBoard to do something. Alternatively, @BOARDNAME@ can potentially be much longer than the physical 11 characters it occupies. PCBEdit needs to take these cases (and others) into account in a true rectangular block so that it can line up correctly on the left and right sides of the block. The only way around it is to select a line or character block instead of a true rectangular screen block. Just remember that L and C blocks are handled differently than B blocks.