1000#COMMENT THIS IS USERMAN21020\)1040PART 4. ADVANCED FILE MANIPULATION1060 1080 1100A) THE FIND COMMANDF1120[As you are entering the text, you noticed that you just spelled@1140license LISENCE and you want to know how many other places,1160you have spelled it like that. Enter]11801260that text string will be printed. You can terminate the>1280search by entering control-C. If the text is not found,1300SECRETARY will print1320"CHAR NOT FOUND".]1340 1360B) THE CHANGE COMMANDSJ1380[Now you want to replace all occurrences of the misspelled word with#1400the correct spelling. Enter]14202300use when they are writing a program in North Star BASIC.>2320The process of making these changes is called "editing".:2340The commands themselves are called the "Line Editor"2360portion of the program.];2380 [To edit (make changes to) a line, you must FIRST/2400specify which line to change as follows:]24202540of the line and you wish to cancel the process and leave*2560the line as it is, enter control-C.]?2580 [After you have entered EDIT 230, and the printer has82600positioned down to the beginning of the next line,;2620hold down the CTRL button with one finger, then pressA2640the appropriate button with another finger for the command.B2660Now release both fingers and follow any further instructions2680below for that command.2700Once completed, enter@2720carriage return to tell the computer to accept the line as12740you have changed it. To verify that it has62760been changed, you can list the line by entering]27804220 1000#COMMENT THIS LINE WILL BE LISTED BUT NOT PRINTED4240\4260G) THE TITLE COMMAND74280[To set up a title of up to 50 characters, enter]#43005320An invalid command or a line without a # right after theA5340line number will terminate the search for imbedded commands>5360and treat the remaining commands as text to be printed.]5380 10#LINE 70(5400 20#TITLE SECRETARY USER MANUAL5420 5440N) THE CHAIN COMMANDK5460[This command will load the file and automatically begin printing it.L5480If this command is imbedded as the last line in a file, multiple filesN5500can be printed as if they were one document. Printing will begin on theL5520next available line, so if you want the chained file to begin on a newH5540page, insert a page eject back slash at the beginning of the file.*5560To automatically chain FILE2, enter]5580<CHAIN FILE25600 5620O) THE PRINT COMMANDL5640[You are now ready to print your final copy. Note that after you typeO5660the "T" of the word "PRINT" and before you enter the carriage retrun, youM5680must position the paper to the line above the first line of print. The5700command is simply] 5720<PRINTJ5740[The print can be terminated by entering control-C. If your printer;5760does not print continuous forms, SECRETARY will pauseJ5780after the last line on a page and wait for you to insert a new page.R5800Position the paper on the first line and enter a carriage return to continueK5820printing. You can also begin printing at a line other than the firstP5840line by following the PRINT command with a starting line number. Caution,P5860however, since the imbedded commands will be ignored if you begin printingB5880after those lines. To begin printing with line 1234, enter]5900<PRINT 12345920\,5940PART 6. MERGING DATA FROM A BASIC FILE5960 O5980[One of the powerful features of this program is the ability to take dataL6000from a North Star BASIC data file and insert it into the printed text.L6020The obvious application is to insert names and addresses. On the diskO6040that you received, there were three additional files: BASICPGM, SAMPLTTR,N6060and SAMPDATA. BASICPGM is a sample BASIC program to create a data file,J6080SAMPDATA, of names, addresses and data. SAMPLTTR is a sample letter16100which uses SAMPDATA as the data to insert.]6120 N6140[The BASIC data file must be a type 3 file. It must contain only stringK6160records of variable length but less than 256 characters. Each stringN6180record contains all of the data necessary for one letter. The record isK6200divided into substrings by a + sign. The data file for the editor, aO6220letter for instance, must contain an up arrow at each place that you want6240to insert a substring.]6260 L6280[To use this facility, first LOAD the letter SAMPLTTR. Then enter the6300command ]6320<MERGE SAMPDATAL6340[The program will find SAMPDATA on disk, check for a type 3 file, loadP6360the first sector into a buffer at the top of the data area, and check thatL6380the first record is a string record less than 256 bytes long. If yourO6400letter is so long that it approaches the top of the data area so there isO6420no room for the BASIC data record, it will print the message "NO ROOM FORL6440BUFFER". The available memory will be reduced by 513 bytes to provide!6460for the BASIC file buffer.]6480 K6500[Once you have LOADed the letter and MERGEd the BASIC data, enter theQ6520PRINT command. It will automatically print one copy of the letter for each<6540record in the file. You do not need to use the REPEAT;6560command. If you stop the print with a control-C, you,6580must execute the MERGE command again.]6600 M6620[If there are more up arrows in the file than substrings in the record,K6640the extra ^ will be ignored. If there are fewer ^ in the letter thanM6660substrings in the record, the extra substrings will be ignored and eachM6680letter will begin with a new record. If you are entering data into theM6700body of the letter, the data must be able to fit on the line containingN6720the ^. Characters that do not fit on the line will be ignored since the>6740editor does not know where to logically split the data.]6760 B6780[Look at BASICPGM and SAMPLTTR for specific examples of thisR6800technique. BASICPGM is provided as an example only. You will want to writeG6820a more sophisticated program to allow addition, modification, andB6840deletion of data, but this will depend on your application.]6860\6880PART 7. ADVANCED FEATURES6900 6920A) THE CALL COMMANDK6940[During the PRINT command, SECRETARY will scan the line for a specialR6960character and call your own subroutine if the character appears in the line.Q6980To call your routine for all lines, search for a carriage return, 0D, whichM7000will be on each line. To ignore all lines, search for the character 0037020hex. This can be used to rescan the line for;7040special printers. A sample test routine is coded in L7060SECRETARY at 2D33. The address of the buffer with the line will beC7080in the HL registers and SECRETARY expects the address of the J7100new buffer line to be in DE registers. The other registers may be H7120destroyed. This is an advanced technique and the user should be aL7140proficient assembler language programmer before attempting to use this7160feature.]7180<CALL 2D33,0D7200 7220B) FILES TOO BIG;7240[If a file on disk is larger than memory, the messageH7260"FILE TOO BIG" will be printed when the file is loaded. SECRETARYO7280will read as much as it can into memory. If the file was large, but the R7300data itself within the file is small enough to fit in memory, SECRETARY willK7320work correctly and the message can be ignored. Otherwise some of theJ7340data will be lost. To be sure that the file was small enough to fitP7360 or to salvage as much of the data as possible if it was too large, enter]7380<RECOVER7400 7420C) FILE TOO SMALLJ7440[If the file on disk is too small to hold all of the data in memory,@7460the message "FILE TOO SMALL" will be printed when the file?7480is saved. SECRETARY will write as much of the file as it#7500can. When the file is loadedI7520back later, however, some of the data will be missing. Since theP7540end-of-file indicator will be missing, SECRETARY will not be able to tellO7560where the file ends. To salvage as much of this data as possible, enter]7580<RECOVER7600\7620D) THE BLOAD COMMANDQ7640[A BASIC program is not in the format that can be processed with SECRETARY.R7660To load a BASIC program and convert it to SECRETARY format in memory, enter]7680<BLOAD BASIC-program-nameR7700[You can then use the editing features of SECRETARY on it. The line numbersM7720in the BASIC program must not exceed 9999 so you may have to do a BASICR7740RENUMBER before BLOADing the file. NOTE: RENUMBER in SECRETARY only changesO7760the line numbers at the left side of the line and not references to thoseP7780line numbers within a line (such as GOTO, GOSUB etc) as the BASIC RENUMBER;7800does. Use CHNG or CHALL to change those references.]7820 7840E) THE BSAVE COMMANDL7860[This is the opposite of BLOAD. It takes a SECRETARY fomatted file inN7880memory, converts it to North Star BASIC, and writes it to disk. Be sureO7900that the disk file is already created, it is type 2 file, and it is largeR7920enough to include any changes that you may have added to the program. SinceM7940the conversion requires searching a large table, the program may take aR7960minute or two to perform this command. To save the BASIC program BASICPGM, 7980enter]8000<BSAVE BASICPGM8020 8040F) THE EXPAND COMMANDN8060[There may be times when you do not need the CONFIGURE, BSAVE, and BLOADH8080commands and you are short of space. You can wipe out these threeL8100commands and get an extra 2K of memory for your text file by entering]8120<EXPANDR8140[This will cause the data area to be EXPANDed. &CAUTION: Do not save a copyR8160of the program after entering EXPAND or you will permanently lose the BSAVE,O8180BLOAD, and CONFIGURE commands. BE SURE TO SAVE ANY TEXT IN THE DATA AREAN8200BEFORE ENTERING EXPAND. ANY TEXT IN THE DATA AREA AFTER ENTERING EXPAND"8220WILL BE PERMANENTLY LOST.& ]8240 8260G) TO QUIT AND RETURNC8280[If you need to QUIT SECRETARY to return to DOS and you later@8300wish to return without destroying the data, jump to 2D04.]8320#CHAIN USERMAN3