1000#COMMENT THIS IS USERMAN2 1020\ )1040PART 4. ADVANCED FILE MANIPULATION 1060 1080 1100A) THE FIND COMMAND F1120[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 print 1320"CHAR NOT FOUND".] 1340 1360B) THE CHANGE COMMANDS J1380[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 has 82600positioned down to the beginning of the next line, ;2620hold down the CTRL button with one finger, then press A2640the appropriate button with another finger for the command. B2660Now release both fingers and follow any further instructions 2680below for that command. 2700Once completed, enter @2720carriage return to tell the computer to accept the line as 12740you have changed it. To verify that it has 62760been changed, you can list the line by entering] 27804220 1000#COMMENT THIS LINE WILL BE LISTED BUT NOT PRINTED 4240\ 4260G) THE TITLE COMMAND 74280[To set up a title of up to 50 characters, enter] #43005320An invalid command or a line without a # right after the A5340line 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 MANUAL 5420 5440N) THE CHAIN COMMAND K5460[This command will load the file and automatically begin printing it. L5480If this command is imbedded as the last line in a file, multiple files N5500can be printed as if they were one document. Printing will begin on the L5520next available line, so if you want the chained file to begin on a new H5540page, insert a page eject back slash at the beginning of the file. *5560To automatically chain FILE2, enter] 5580<CHAIN FILE2 5600 5620O) THE PRINT COMMAND L5640[You are now ready to print your final copy. Note that after you type O5660the "T" of the word "PRINT" and before you enter the carriage retrun, you M5680must position the paper to the line above the first line of print. The 5700command is simply] 5720<PRINT J5740[The print can be terminated by entering control-C. If your printer ;5760does not print continuous forms, SECRETARY will pause J5780after 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 continue K5820printing. You can also begin printing at a line other than the first P5840line by following the PRINT command with a starting line number. Caution, P5860however, since the imbedded commands will be ignored if you begin printing B5880after those lines. To begin printing with line 1234, enter] 5900<PRINT 1234 5920\ ,5940PART 6. MERGING DATA FROM A BASIC FILE 5960 O5980[One of the powerful features of this program is the ability to take data L6000from a North Star BASIC data file and insert it into the printed text. L6020The obvious application is to insert names and addresses. On the disk O6040that 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 letter 16100which uses SAMPDATA as the data to insert.] 6120 N6140[The BASIC data file must be a type 3 file. It must contain only string K6160records of variable length but less than 256 characters. Each string N6180record contains all of the data necessary for one letter. The record is K6200divided into substrings by a + sign. The data file for the editor, a O6220letter for instance, must contain an up arrow at each place that you want 6240to insert a substring.] 6260 L6280[To use this facility, first LOAD the letter SAMPLTTR. Then enter the 6300command ] 6320<MERGE SAMPDATA L6340[The program will find SAMPDATA on disk, check for a type 3 file, load P6360the first sector into a buffer at the top of the data area, and check that L6380the first record is a string record less than 256 bytes long. If your O6400letter is so long that it approaches the top of the data area so there is O6420no room for the BASIC data record, it will print the message "NO ROOM FOR L6440BUFFER". 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 the Q6520PRINT 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 than M6660substrings in the record, the extra substrings will be ignored and each M6680letter will begin with a new record. If you are entering data into the M6700body of the letter, the data must be able to fit on the line containing N6720the ^. 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 this R6800technique. BASICPGM is provided as an example only. You will want to write G6820a more sophisticated program to allow addition, modification, and B6840deletion of data, but this will depend on your application.] 6860\ 6880PART 7. ADVANCED FEATURES 6900 6920A) THE CALL COMMAND K6940[During the PRINT command, SECRETARY will scan the line for a special R6960character 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, which M7000will be on each line. To ignore all lines, search for the character 00 37020hex. 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 be C7080in 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 a L7140proficient assembler language programmer before attempting to use this 7160feature.] 7180<CALL 2D33,0D 7200 7220B) FILES TOO BIG ;7240[If a file on disk is larger than memory, the message H7260"FILE TOO BIG" will be printed when the file is loaded. SECRETARY O7280will 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 will K7320work correctly and the message can be ignored. Otherwise some of the J7340data will be lost. To be sure that the file was small enough to fit P7360 or to salvage as much of the data as possible if it was too large, enter] 7380<RECOVER 7400 7420C) FILE TOO SMALL J7440[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 loaded I7520back later, however, some of the data will be missing. Since the P7540end-of-file indicator will be missing, SECRETARY will not be able to tell O7560where the file ends. To salvage as much of this data as possible, enter] 7580<RECOVER 7600\ 7620D) THE BLOAD COMMAND Q7640[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-name R7700[You can then use the editing features of SECRETARY on it. The line numbers M7720in the BASIC program must not exceed 9999 so you may have to do a BASIC R7740RENUMBER before BLOADing the file. NOTE: RENUMBER in SECRETARY only changes O7760the line numbers at the left side of the line and not references to those P7780line 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 COMMAND L7860[This is the opposite of BLOAD. It takes a SECRETARY fomatted file in N7880memory, converts it to North Star BASIC, and writes it to disk. Be sure O7900that the disk file is already created, it is type 2 file, and it is large R7920enough to include any changes that you may have added to the program. Since M7940the conversion requires searching a large table, the program may take a R7960minute or two to perform this command. To save the BASIC program BASICPGM, 7980enter] 8000<BSAVE BASICPGM 8020 8040F) THE EXPAND COMMAND N8060[There may be times when you do not need the CONFIGURE, BSAVE, and BLOAD H8080commands and you are short of space. You can wipe out these three L8100commands and get an extra 2K of memory for your text file by entering] 8120<EXPAND R8140[This will cause the data area to be EXPANDed. &CAUTION: Do not save a copy R8160of 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 AREA N8200BEFORE ENTERING EXPAND. ANY TEXT IN THE DATA AREA AFTER ENTERING EXPAND "8220WILL BE PERMANENTLY LOST.& ] 8240 8260G) TO QUIT AND RETURN C8280[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