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]
1180<FIND LISENCE
K1200[SECRETARY will search the file for the text beginning with the first
J1220nonblank character after the word FIND and ending with the character
:1240preceding the carriage return.  All lines containing
>1260that 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]
1420<CHAL LISENCE^LICENSE
?1440[SECRETARY will search for all occurrences of LISENCE and
P1460replace it with LICENSE.  The up arrow separates the text string that you 
H1480are searching for from the text string that you are replacing.  If
N1500you want to delete a text string, enter the string to search for, the up
A1520arrow, and a carriage return without the replacing string.]
1540<CHAL DELETE THIS STRING^
P1560[If you do not want to change all occurrences, but you may want to replace
+1580some depending on the context, enter]
1600<CHNG LISENCE^LICENSE
E1620[Each time LISENCE is found, it will be replaced by LICENSE and
L1640the line will be printed.  If you do want to have the new line replace
O1660the current line, enter a carriage return.  If you do not want the change
K1680to take effect, enter control-A.  If you want to terminate the change
J1700without replacing the line just printed, enter control-C.  All other
41720characters that you may enter will be ignored.
?1740After the first occurrence has been replaced, the line is
81760rescanned for any other occurrences of the string.
;1780Therefore do not replace a phrase with another phrase
<1800which contains the original pharse i.e. do not replace
=1820X with XY or the result will be an entire line of Y's. 
H1840If you must change X to XY, do it in two steps.  First change X to
!1860something obscure like $+=.
1880Then change $+= to XY.]
1900 
1920C) THE MOVE COMMAND
O1940[After reading over the text that you have entered, you decide that lines
R1960200 through 230 would sound better after line 450.  You can move these lines
1980by entering]
2000<MOVE 200,230,451
F2020[Lines 200 through 230 will be copied starting with line 451 and
P2040incremented by 1.  Then lines 200 through 230 will be deleted.  Note that 
Q2060if there was a line 451 or 452, it would be replaced by the text of 200 and
72080230.  To move only a single line like 200, enter]
2100<MOVE 200,200,451
2120\
2140D) THE COPY COMMAND
J2160[If you want to copy the lines without deleting the old ones, enter]
2180<COPY 200,230,451
:2200[This is just like the MOVE but without the delete.]
2220 
2240E) THE EDIT COMMAND
/2260     [SECRETARY provides the same control
=2280characters for making changes to lines that programmers
>2300use 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:]
2420<EDIT 230
@2440    [Notice that the computer will do a return to the left
@2460side of the page but does not print the usual prompt of #.
B2480This is because it now awaits one of the commands below or a
B2500carriage return only which says to cancel the edit operation
@2520while leaving line 230 as it was.  If you have edited part
>2540of 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]
2780<LIST 230,230
(2800 The valid control characters are:
"2840CONTROL-A Copy one character
E2860CONTROL-G Copy the remaining portion of the old line to the end
 2880          of the new line.
H2900CONTROL-D Copy up to a specific character.  This control character
J2920          requires a second character to be entered.  SECRETARY will
I2940          scan the old line for this second character, and if it is
F2960          found, copy all the characters up to but not including
D2980          the second character to the new line.  If the second
C3000          occurrence of a character is to be found, control-A
?3020          must be used to copy the first character before
,3040          control-D can be used again.
G3060CONTROL-Z Delete one character from the old line.  A percent sign
H3080          is echoed back to indicate a character has been deleted.
'3100CONTROL-Q Backspace one character
J3120          You can also backspace with the character that you defined
+3140          as the backspace character.
I3160CONTROL-Y Toggle insert mode.  The first time control-Y is entered,
I3180          the new line is "opened up" and all subsequent characters
H3200          are added to the new line.  The second time control-Y is
I3220          entered, the new line is "closed" so  that characters are
#3240          no longer inserted.
!3260CONTROL-C Exit this command
$3280CONTROL-N Reedit the new line.
$3290CONTROL-P Reedit the old line.
3300 
&3320PART 5. WORD PROCESSING COMMANDS
3340 
N3360[Now that you have edited your file and listed it , you are now ready to
J3380print it.  Certain parameters need to be set before you can do this,
3400however.]
3420 
3440A) THE SPACE COMMAND
A3460[To set the line spacing for other than single space, enter
/3480the number of lines that you want spaced]
#3500     SPACE 2   (double space)
'3520     SPACE 3   (triple space etc)
3540 
3560B) THE LINE COMMAND
H3580[The length of the output line does not have to be the same as the
K3600input line.  The maximum length of the output line is 132 characters.
$3620To set the line length, enter]
3640     LINE 60
3660     LINE 132
3680 
3700C) THE OFFSET COMMAND
H3720[Sometimes the printer may print too close to the left edge of the
O3740paper and you may want to move the entire page to the right.  If you want
B3760to move the entire page to the right by 5 characters, enter]
3780<OFFSET 5
3800 
3820D) THE MARGIN COMMAND
@3840[This command sets the first and last columns of the page.
@3860To cause the line to be printed starting in position 5 and
#3880ending in position 75, enter]
3900<MARGIN 5,75
+3920[This could also be done by entering]
3940     OFFSET 4
3960     LINE 71
3980 
4000E) THE JUSTIFY COMMAND
G4020[To cause the lines contained within brackets to justified to the
54040right margin in addition to line filled, enter]
4060<JUSTIFY ON
4080 
4100F) COMMENTS
L4120[A comment may be entered into the text file as one of the first lines
I4140before the real text by entering a # and the word COMMENT after the
L4160line number.  Your comment may follow the word COMMENT.  The line will
J4180be listed during the LIST command, but it will be ignored during the
4200PRINT command.]
>4220   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]
#4300<TITLE THIS TEXT IS THE TITLE
C4320[The title begins with the first nonblank character after the
84340word TITLE and ends with the carriage return.  The
94360title is printed on the first line of any page that
4380also gets a page number.]
4400 
4420H) THE TABSET COMMAND
J4440[Up to 10 tabs can be set.  To set tabs at columns 5, 10, 30 and 45,
4460enter]
4480<TABSET 5,10,30,45
4500 
4520I) THE REPEAT COMMAND
=4540[You can also get multiple copies printed.  To get five
4560copies, enter]
4580<REPEAT 5
4600 
4620J) THE PAGE COMMAND
J4640[The dimensions of a page can also be changed.  A normal 8 1/2 by 11
O4660inch page contains 66 lines total.  With a one inch margin at the top and
K4680bottom, there are 54 print lines with the first line on line 7.  This
84700standard page is the default but could be entered]
4720<PAGE 66,54,7
4740 
#4760K) THE PAGE NUMBERING COMMAND
@4780[Unless your text is very short, only a few pages will fit
@4800in memory at one time.  You may have pages 1 through 10 in
F4820one file and pages 11 through 20 in a second file.  To print the
B4840second file, it is necessary to tell SECRETARY to begin with
G4860page number 11.  This is done with the PNUM command.  Be sure not
A4880to confuse PNUM with PAGE.  The highest page number is 249.
#4900Note the three uses of PNUM:]
&4920     PNUM 5  (begin with page 5)
@4940     PNUM 0  (begin with page 1 but print it starting with
'4960                page 2 on page 2)
)4980     PNUM 251 (omit page numbering)
5000 
5020L) THE UNIT COMMAND
N5040[To cause the print to come out on an additional printer rather than the
;5060CRT, enter the unit number  as described in  PART 2.]

5080<UNIT 1
5100\
5120M) IMBEDDED COMMANDS
E5140[Many of these commands will be the same every time you print a
G5160particular file and it is inconvenient to reenter them each time.
E5180To make this more automatic, all of the commands here in PART 5
5200except REPEAT
N5220may be entered in the text file preceded by a #.  They must be the first
K5240lines in the file.  Note how they appear in your listing of DEMOFILE.
@5260The imbedded commands MUST be the first lines in the file.
@5280The only exception to this rule is the COMMENT, SPACE, and
;5300CHAIN commands which can be imbedded within the file.
>5320An 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
