WORDWISE PLUS BREAK KEY If used with menu options 6,7 or 8 text will be lost. In Edit mode WWPLUS assumes that you pressed BREAK by mistake and tries to retrieve your text. "Press any Key" means any key except BREAK. MAIN MENU Toggles exactly as Wordwise...1 extra option No.9 SEGMENTS MENU. ENTERING TEXT Exactly as Wordwise. CURSOR CONTROL Exactly as Wordwise. INSERT & OVERWRITE Toggles using f0 as does Wordwise. DELETE Exactly as Wordwise CAPITALS & LOW CASE Position cursor at LEFT of letter to be altered and use CTRL+ s(OR S). The character will be 'case changed' and the cursor will move to the right. This will continue just so long as you hold down CTRL/S SAVING & LOADING Exactly as Wordwise REMEMBER If there are any characters in the text you LOAD which Wordwise Plus regards as illegal, these characters will be replaced by "^" since this is the pad character and will be printed as a space.Illegal characters are ASCII 32,126 and 221 which is the TAB character. FORMATTING & PRINTING Using option 7 Wordwise Plus gives priority to 2 effects namely Underlining and Double Strike.Underlined words appear on the screen underlined and double strike are inverted on the preview screen (black on white) PROGRAMMING RED KEYS Red keys can store words,phrases or embedded commands without interfering with Wordwise Plus in any way.Once you have programmed a key from the main menu, to get it to produce its contents in EDIT mode Simply use CTRL/SHIFT+(the red key).In practice useful commands can be placed between f1 & f2. WORD COUNT Use f5 as with Wordwise SAVE MARKED TEXT Exactly as Wordwise DELETE MARKED TEXT " " " MOVE MARKED TEXT " " " COPY MARKED TEXT " " " RELEASE MARKERS Use CTRL/R When marked text is DELETED the markers are released automatically. SEARCH & REPLACE option 5. Make sure you make a copy of memory before starting to alter. All search & replace instructions are obeyed from the cursor onwards ONLY.So if you leave the cursor at the bottom of the text, nothing will happen. The flashing Global or Selective? means do you want it to process the whole text automatically, or do you want to check each substitution.Choose s to begin with so you can see what is going on.You will be prompted "Please enter search string" Type in any WORD you want changed "Please enter replace string" Enter the replacement WORD You should now see your text in EDIT mode with the cursor marking the position of the first word and a flashing 'Replace?(Y/N).If you press Y the exchange will be made.Anything else will leave the text unchanged.Either way you will move forward to the next occurance of the search string.Press Y or N until you reach the end. It is unexpectedly literal; it treats 'it ' & 'It ' as 2 different strings and the ending space is vital if you don't want to process all occurrances of 'itself','items',&c.You will need a space before ' it' to avoid 'hit','with','written' &c. If you press RETURN in response to request for replace string, the replacement will delete the search string. If you just want to search, not replace, make a selective search and press N every time If you are doing successive search & replace operations on the whole text remember to return the cursor to the top of the document each time. OUTPUT IN PAGES Default values PL=66 LL=96 Without Margins HEADINGS & FOOTINGS Exactly as Wordwise LINE NUMBERS f1LNSf2 allows you to preview line numbers as long as you have EP'd USING f4 From anywhere in a document, f4 followed by a character(neither of which print) moves the cursor FORWARD to the next occurrence of the specified character. SEGMENTS There can be 10 segments numbered 0 to 9 The f/keys call them up Segments can contain text or procedures The bigger the segments the smaller the remaining memory for the main text. SEGMENT Menu ESCAPE toggles between segment menu & segment text as in main menu. Remember however that whereas the main menu shows 'start' & 'end', the segment menu shows 'SEG' & 'ENDSEG' so don't type them in again or you'll have trouble Options 1 to 4 are exactly as their MAIN menu counterparts Option 5 tells you which segment is selected...It is always 0 to start with. Options 6 & 7 are exactly as the MAIN menu Option 8 deletes the selected segment by pressing 'Y' Option 9 Returns you to the MAIN menu THERE ARE 2 INVISIBLE COMMANDS * and : * permits any operating system command to be typed in :Enables you to use all the WORDWISE PLUS commands immediately and these can also be used to create programs held in segments. USING SEGMENTS FOR TEXT Suppose you want to break off from a long document to do a quick memo or a label.Instead of having to save your document and reload it later, just nip into a segment.Write what you wish; edit it and preview it if you wish.Then print it out.You can SAVE it if you want to.Your main text remains undisturbed. Suppose you want to write several letters made up of differing arrangements of standard paragraphs.Put one paragraph into each segment and call them as required with :TYPE SEGMENT (0 to 9) USING SEGMENTS FOR PROCEDURES Suppose you want a document printed 6 times and don't want to stand around. If you want each copy to start on a new page be sure you have EP'd and make sure the text ends with a last embedded command of BP(Begin Page). Now enter the segment menu & press ESCAPE to put the procedure into segment 0.If you want 6 copies type:- SELECT TEXT DOTHIS PRINT TEXT TIMES 6 Now return to either Menu and SHIFT/f0 Your 6 copies will emerge If your procedure was on segment 3 then press SHIFT/f3 *COMMANDS FROM WITHIN WORDWISE PLUS e.g. The quickest way of getting a printout of a catalogue is f1*CATf2 and press option 6. CONTROL KEYS Exactly as Wordwise with the additions:- CTRL/F Changes the on-screen formatting.Normally words are not split between the end of one line and the start of he next.Occasionally this can be a nuisance and CTRL/F can be used to prevent this.This actually RE-displays the screen from the cursor onwards.Pressing CTRL/F again restores the on screen formatting. Personal Note:- If you have ADFS installed CTRL/F will put you into ADFS. CTRL/R Deletes all markers CTRL/W Causes the computer to recount the number of words, setting W% and changing the word count in the corner of the screen.It performs exactly the same operation as the command RECOUNT. Here is a better explanation of TAB. When pressed this enters a TAB code into the text which is shown as a small right-facing arrow.This will cause spaces to be output until the next defined TAB stop when printing or previewing.See also DT embedded command. FUNCTION KEYS Can be used in 3 different ways a) f.KEY b) SHIFT/f.KEY c) CTRL/SHIFT/f.KEY a) Exactly as Wordwise. If when trying f7,f8, or f9 the computer beeps and the message 'MARKERS' flashes there has been an error.Perhaps there is no marked section to work with or the cursor is currently between the two markers.It is not possible to move a marked section to the middle of itself. b) Makes the computer try to run a program in the segment corresponding to the f.KEY pressed.If it is empty nothing will happen; but if it contains text rather than a program an error will occur. Running programs in this way will also work with either of the menus on the screen. c) As in BASIC you can program the f/keys using *KEY The only difference is that it only responds to CTRL/SHIFT/f.KEY e.g *KEY4 Chapter ESCAPE (to EDIT) CTRL/SHIFT/f4 'Chapter' has been inserted into the text. EMBEDDED COMMANDS Exactly as Wordwise For the Advanced:- Embedded commands should be terminated with f2 or RETURN but not both unless you want to end the command and then have a carriage return. It is possible to execute segments from within embedded commands e.g. f1 DF SEG7 f2 will cause segment 7 to be executed every time a footer is required. Similarly it is possible to have embedded commands within programs in segments.This applies particularly to TYPE and DOLINE commands but not to PRINT. PRINT A$ will print A$ on the screen but not enter it into your text TYPE A$ will enter A$ into your text PRINT"Just testing" must not contain any embedded commands TYPE "^Gce^W****END OF SECTION****^R" will enter the embedded command f1 ce f2 ****END OF SECTION**** into your text in memory. OPERATING SYSTEM CALL The * embedded command can be placed in the text and the whole of the rest of the line will call the O.S in the usual way. f1*catf2 f1*infof2 The resulting output will be sent to the printer or screen. Wordwise-Plus is unable to keep track of the line count sent to the printer by the O.S so if you have EP'd,then the rest of the document text in memory may well be incorrectly placed in the printed output.However previewing before printing should enable adjustments to be made. NEW Embedded Commands DE Double-strike End...same as OC27,72 DS Double-strike Start...same as OC27,71 ES Escape sequence e.g f1ESf2 will just send ASCII 27(ESCAPE) f1ES 52f2 is the same as 27,52 f1ES "R",8f2 is the same as 27,82,8 The codes can be given in different ways character-e.g "R" decimal---e.g 10 HEX-------e.g &34 Binary----e.g %10101110 Octal-----e.g @377 The first code can be placed next to the ES but subsequent codes must be seperated by commas. f1ES"D","M,32,&32,@171f2 Note:- As usual the command must not extend beyond the end of the line. FI Fully Indent. Makes a line of text cling to right-hand side of the page instead of the left e.g f1FIf2 10 Downing Street, f1FIf2 Westminster f1fif2 London. yeilds 10 Downing Street Westminster London.1 N.B FI takes all text up to the next RETURN as text to be acted upon Contrast the above with the layout produced by IN50 10 Downing Street Westminster London. LNE Line Number End Turns off line numbering LNS Line Number Start When previewing it is useful to be able to number the lines particularly when setting top & bottom spaces or when using a footer command. LNS & LNE turns this facility on and off. You may find it useful to put markers around a particular section so you don't have to preview the whole document. If line numbering is on when previewing a marked section the line numbers show exactly where on the page the section belongs Line numbers are inserted in front of the first character of each line.Long lines may then spill over to the next SCREEN line OPS Output Print Sequence e.g f1OPS 0f2 f1ops9f2 f1ops A%f2 There are 10 possible defined sequences that can be set up and sent to the printer on demand.Four of these sequences (OPS0 to OPS3) are initially set up but all may be redefined using the Redefinee Print Sequence(RPS) command. Sequences 0 to 3 can also be sent to the printer with other specific commands Sequence Equiv. Default ASCII OPS0 US ESC"-"1 27,45,1 OPS1 UE ESC"-"0 27,45,0 OPS2 DS ESC"G" 27,71 OPS3 DE ESC"H" 27,72 OS Operating System Call f1os"cat"f2 f1OS"HELP"f2 f1os A$f2 This command will pass the string to the operating system and at the same time will copy all the resultant screen output to the printer if using option 6.Thus All the following HELP messages are available on my computerf1"HELP"f2 will include the help messages in the printed text. Note that Wordwise-plus will not keep track of the number of lines output, and all paging will probably be ruined. This is unavoidable. PA Pause f1paf2 You can pause in the middle of printing a document to say,change a daisy wheel, by using PA. Hit spacebar to continue. Works also in preview & spool PF Print File f1PF A$f2 f1pf"INSERT"f2 Enables another file to be included in the output when printing or previewing or spooling.All embedded commands in the included file are obeyed except a request for a further included file. Can be used to join a number of standard paragraphs f1pf"address"f2 10 Downing Street Westminster f1PF"meeting"f2 Dear Member There will be a meeting on.............at the usual venue f1"ender"f2 Yours sincerely Prime Minister. PS Print String f1ps A$f2 f1PSf1CEf2 Will process and insert a string during printing,previewing or spooling Since the current filename is held in F$, one can include the working filename in headers & footers. RPS Redefine Print Sequence There are 10 possible sequences that can be set up and sent to the printer on command Four of these sequences(ops0 to ops3) are initially set up, but ALL may be re-defined using RPS. Initially:- Sequence Equiv. Default ASCII OPS0 US ESC"-"1 27,45,1 OPS1 UE ESC"-"0 27,45,0 OPS2 DS ESC"G" 27,71 OPS3 DE ESC"H" 27,72 To define OPS7 to produce italics on an Epson RX-80.....f1RPS 7,27,52f2.A maximum of 5 characters can be assigned to any one programmable sequence. SEG Executes a program in segment f1SEG 1f2 f1seg A%f2 A segment can be called from within a piece of text.The segment itself may well contain a program to print out a text, or to change values such as Line Length. UE Underline End Terminates underlining induced by US The codes generated are 27,45,0 (EPSON) but these can be changed to suit other printers with RPS US Underline Start f1usf1 f1USf2 The code generated is 27,45,1(EPSON) but this can be changed to suit other printers with RPS When previewing text, underlining is shown if preview is in 80 column mode. COMMANDS Most of the commands can be used in 2 different ways.either as an instruction in a program or as an immediate command from a menu. To execute a command from either of the menus you must first type a colon when the computer asks you to enter your choice, and then the rest of the command. e.g :PRINT 5+3 will yeild the answer 8 :P. 5+3 will do the same If you use the command in a program you must omit the colon BASIC abbreviations apply. BPUT# CALL All as BASIC CLOSE# CLS CURSOR Moves the cursor about the text and must ALWAYS be followed by one of the following RIGHT LEFT UP DOWN BOTTOM TOP AT CURSOR RIGHT & CURSOR LEFT These commands cause the cursor to behave just as the cursor keys do.When followed by a number this indicates the number of characters to be moved. CURSOR UP & CURSOR DOWN Without a number moves up or down 1 line.With a number, moves that number of lines CURSOR TOP & CURSOR BOTTOM Move the cursor to the start or the end of the text CURSOR AT Followed by a number 0 to 39 determines where on the current line the cursor will move to. DEFAULTS Resets the printer parameters to their default values DELETE Must be followed by one of 5 other keywords LEFT AT WORD MARKERS MARKED DELETE LEFT Deletes character as if using the DELETE key.Unlike DELETE AT it is the characters to the left that get rubbed out.DELETE LEFT can be followed by a number(or numeric expression) to indicate how far to go.If no number is there only 1 character will be removed. DELETE AT Has the same effect as CTRL/A and deletes-at and to the right of-the cursor.It can be followed by a numeric expression. e.g:-delete left 4 delete at 33 DELETE Word A% delete MARKED DElete marKERS DOLINE DOLINE " GCE WThis is centered" DOLINE " GFI WThis is fully indented" This command takes a line of text and prints it on the screen.This line of text though can contain embedded commands which will affect its format.TO INCLUDE AN EMBEDDED COMMAND you must precede it with G and follow it with W.These stand for the Green and White characters which you get in Edit mode when pressing f1 & f2.This command is especially useful for sending one line to the printer using VDU2 & VDU3. DOTHIS e.g DOTHIS PRINT"hello" TIMES 12 DOTHIS TYPE "A" TIMES 3*A% This makes the computer repeat a set of instruction a given number of times END As BASIC ENDPROC As BASIC FIND e.g FIND A$ IF X%=4 then FIND "end" FIND Markers FIND searches the text(or segment) for a character string and moves the cursor to the first letter of the given word.If the word is not found the cursor will not move.FIND MARKERS will search for the first marker in the text FKEY WORDWISE-PLUS pre-defines the 10 red keys; for example f3 inserts a marker.You can make a program act as though one of the keys has been pressed with FKEY e.g FKEY 1 fkey 0 fkey 4 "F" Fkey 4 " G" FKEY 5 A$ FKEY 6 "PRINT" FKEY 3 will insert a marker at the cursor position Normally if you press f4,f5 or f6 you are asked to press a key which specifies the character which the computer should search for. N.B. You cannot search for markers using FKEY....Use FIND MARKERS Normally when using f7 to delete text between markers,if you are about to delete more than 250 characters the computer will ask if you are sure.FKEY does not do this so make sure that your markers are in the right place first. GOTO Serves the same purpose as BASIC GOTO but since WORDWISE-PLUS has no line numbers, labels are used preceded by a "." as in assembly language.It must be on a line on its own. GOTO start REM This is ignored .start GOTO can only be used inside a segment and can only jump to a label in the same segment IF..THEN Evaluates the expression following the IF and executes the following statement if the result is true.Unlike BASIC the THEN is compulsory and there is no ELSE clause LET as BASIC LOAD Generally as BASIC; however there are 2 things you must type after it. 1) One of the following TEXT TTC PARAMS 2) The file name LOAD TEXT Is exactly like option 2 on both menus. Use SELECT to choose which file Unlike the menu option this does not warn you if you are about to overwrite your current text. LOAD TTC Loads text to cursor like option 4 on the menus.Will load to main text or segments LOAD PARAMS Loads a file which has been saved by SAVE PARAMS.This provides an easy way of setting you printer's parameters OSCLI OSCLI "TAPE" will do exactly the same as *TAPE.The difference between the two is that OSCLI is followed by a string expression which means it can include variables. A$="B" OSCLI "DIR"+A$ will set the directory to B PREVIEW Is a command which shows a piece of text on the screen as it would appear if printed. PREVIEW TEXT Preview Page 4 preview MARKED Preview file G$ PRINT Generally as BASIC but be careful not to confuse PRINT with TYPE as PRINT does not insert text into your document or segment PRINT can also send text to the printer similar to option 6 provided it is followed by one of the following TEXT MARKED PAGE FILE PROC This calls a procedure but they are more like BASIC GOSUBS than BASIC procedures. .HELLO print this is a procedure A%=5 A%=A%*A% print A% ENDPROC It starts with a label, which must be on a seperate line, and ends as in BASIC with ENDPROC. It is called by typing PROC HELLO and can only be called by a program within the same segment. PTR# Exactly as BASIC RECOUNT Changing the value of W% or using the command TYPE may make the indicated word count inaccurate.Use RECOUNT for text or segment REM Exactly as BASIC REPEAT As BASIC except that the limit for nested loops is 7 REPLACE e.g REPLACE "news","Information" REPLACE A$,B$ A command which searches for the first occurrance of its first argument from the cursor onwards, and replaces it with its second argument.Both arguments must be string expressions and be separated by a comma. For the whole document remember to place the cursor at the start. REMEMBER that:- :REPLACE "out" will change 'about' into 'ab' :REPLACE "out","in" will change 'about' into 'abin" SO LEAVE SPACES FOR AND AFT in your search string so:- :REPLACE " out ","in" SAVE Unlike BASIC it must be followed by 2 things 1. One of the following keywords TEXT MARKOD PARAMS 2. A string which tells the computer what the file name will be. e.g SAVE TEXT "index".......Like option 1. Save Marked "A."+B$.....Like option 3. SAVE PARAMS H$ This sets all the parameters set by embedded commands including line length, line width and all the special code sequences sent to the printer.There is also the sister command LOAD PARAMS that load them back again.You only need to set the printer code once, SAVE them and subsequently load them from disc every time you use WORDISE=PLUS. SELECT A statement that selects the main text or one of th 10 segments for subsequent editing. When you run a program from a segment you must be careful that it is editing the piece of text you want it to.SELECT does this. e.g Select TEXT Select Segment A% If no numeric expression is present, the last segment used will be selected Take the following example Select TEXT A$=GCT$ SELECT SEGMENT 3 Cursor TOP TYPE A$ This will read a character from the text and will then enter it at the start of segment 3. SELECT TEXT or SELECT SEGMENT can both be used from either of the menus SELECT TEXT will transfer you to the main menu SELECT SEGMENT will transfer you to the segment menu SPOOL Saves all text to file in its formatted state(as previewed), as does option 8 of either menu. SPOOL must be followed by Text Page Marked or File e.g SPOOL TEXT A$ spool page "FRED",3 Spool marked "W."+"next" Spool File "to" "from" 1. Spool all the text on file A$ 2. Spool page 3 of the current text or segment to a file called FRED 3. Spool the marked section to a file in Directory W and called 'next' 4. Spool a file called 'from' and store it as a file called 'to' SWAP When in edit mode you use CTRL/S to change the character case at the cursor position.To do this in a program or from a menu you must use SWAP.If no numeric argument follows it, it will behave as though CTRL/S had been pressed only once.If it has a numeric argument the swap will occur for that number of characters going right. e.g SWAP.........change 1 SWAP 6.......change 6 A%=4 SWAP A%-1....change 3 The command has no effect on non-alphabetic characters TIMES e.g TIMES 6 times I%*3 A program object that signifies the end of a DOTHIS..TIMES loop.It must be followed by a numeric expression which determines how many the loop is executed TIMES without a DOTHIS statement will generate error "No Repeat" TYPE A command that inserts text into your main text or segment at the position of the cursor.If it is followed by a string expression, then that string is inserted.If it is followed by SEGMENT and a number, then that segment is inserted.A segment can not be inserted into itself Type "Cairo Computer Club" TYPE A$ type segment 8 After inserting, the word-count will be incorrect....Use RECOUNT UNTIL Exactly as BASIC VDU e.g VDU 2 VDU 31,12,Y% Like BASIC the VDU command can be used to print characters on the screen by sending their ASCII numbers to the VDU drivers.In this respect it is like PRINT CHR$(X%); In BASIC though, VDU is most useful for sending control codes to the VDU drivers.But with WORDWISE-PLUS changing mode using VDU22 may lose you all your text. Useful are:- VDU 7 beep VDU 31,X%,Y% move cursor to X%,Y% VDU 23,1,0;0;0;0; turns cursor off VDU 23,1,1;0;0;0; turns cursor on VDU 2 printer on VDU 3 printer off FUNCTIONS ASC Exactly as BASIC BGET# As BASIC but don't confuse it with GCF$#.This also reads a character from a file but gives you the character itself and not its ASCII value like BGET# CHR$ Exactly as BASIC EOF# " " " EOT Similar to EOF# but refers to resident text rather than a file and can be used on both main text and segments NOTE:-EOT will only return TRUE if the cursor is on the last character(a space is a character).You may be on the last visible symbol WITHOUT being on the last character.It is best to position the cursor deliberately beforehand. EXT# Exactly as BASIC FALSE Exactly as BASIC FREE Returns the number of free characters so that ypu can find out from a menu or when running a program. e.g X%=FREE PRINT X% or Print free GCF$#...Get a Character from File e.g D$=GCF$#Y% If GCF$#Z%=Y% THEN Print "YES" Is similar to BGET# but if the next character was 'A' then PRINT BGET#C% will print 65 whilst PRINT GCF$#C% will print A Note that in both cases the commands are followed by a variable C% which is the channel number which must be obtained using OPENIN before trying to use either of these commands. GFK$......Get a Character from Keyboard Like BASIC GET$ waits for a key to be pressed and returns that character e.g A$=GCK$ Until gck$="Y" A$=A$+GCK$ A$=GCK$+A$ As with GET$ the character typed will not appear on the screen unless PRINT GCK$ is used GCT$Get Character from Text Reads one character at the cursor position which is then moved on one place. e.g UNTIL GCT$=" " D$=GCT$+A$ PRINT GCT$ GET Exactly as BASIC GLF$# Get a Line from File Lets you read a whole line from a file on your disc in one go.By 'a line' we mean a string of characters up to the next Carriage return or until a total of 255 characters whichever comes first. As with BGET# and GCF$# it must be followed by a variable that contains a channel number.Suppose we have a file named 'A-FILE' that contains 1000 character A's without a carriage return,then C%=OPENIN "A-FILE" A$= GLF$#C% will put a string of 255 A's into the variable A$ GLK$Get Line from Keyboard Waits for the operator to type a series of characters and then press RETURN.The text which is entered then gets returned as a string without the RETURN on the end.Unlike GCK$ the characters appear on the screen as you type them rather like BASIC's INPUT GLT$ Get Line from Text Reads a sequence of characters from the cursor in your current text (rather than a file or keyboard) and stops at the first carriage RETURN or at 255 characters.If the end of the text is reached before either of these conditions you will get a beep telling you that it has been unable to get a full line.This makes little difference as you will still have read up to the end of the text.When GLT$ has finished the cursor is moved on 1 character Be careful not to confuse a line on the screen with a line as GLT$ reads it looking for a RETURN LEN Exactly as BASIC OPENIN Exactly as BASIC OPENOUT Exactly as BASIC PTR# Exactly as BASIC SOT ...Start Of Text Tells if the cursor is at the first character position of your text or segment.If this is so 65535 (TRUE) will be returned if not 0 (FALSE) NOTE:-SOT will only return TRUE if the cursor is on the first character of the first line.You may use the command CURSOR 0 to ensure that the cursor is at the far left of the current line before testing with SOT TIME Exactly as in BASIC TRUE Represented by 65535 in WORDWISE-PLUS VAL As in BASIC function VAL takes a string such as "45abc" which contains numbers and characters and returns the number which is represented namely 45.The string must start with a positive digit,for unlike BASIC a negative will yeild 0 as will a letter or symbol other than 0 to 9.Similarly VAL("+32") will yeild 0. Also unlike BASIC the first element of a string can be a variable or another function. B%=65 PRINT VAL("B%") VARFREE In WORDWISE-PLUS string variables like A$ or E$ are always stored in an area of memory just over 600 bytes long.This means that in all string variables A$ through to Z$ the total number of characters cannot add up to more than 613, or you will get the error "No $ Room".You can keep a check on this with VARFREE e.g Print VARFREE X%=varfree WORDS You can find the word-count from either of the menus or a program by using WORDS.e.g A%=WORDS or PRINT WORDS A% only lets you READ this number.If you want to change it you must alter W% PRINT W% and PRINT WORDS are the same, but you can't alter WORDS Make a habit therefore of never using W% as a program variable SEGMENTS There are 10 available 0 to 9 Segments are introduced for 4 main reasons. 1) So you can easily add your own editing functions 2) So that you can use each segment as a jotter for notes.The jotter can be saved and then entered into the main text if required 3) So that you can generate programs within WORDWISE-PLUS to 'drive' the wordprocessor.These programs can handle mathematical as well as string operations and can deal with random access files 4) Since it provides a powerful language programming capability within a wordprocessor,application programs can be publised which can completely change the way the produce behaves.It can be a wordprocessor to one person and quite a sophisticated invoice generator to another. IDEA No1 Transposition Two letters are often typed in reverse "transpose" or "trasnpose".This program in segment 5 automatically corrects such a mistake with SHIFT/f5 SEG 5 A$=GCT$ DELETE LEFT CURSOR LEFT TYPE A$ DISPLAY ENDSEG IDEA No.2 Unformatter Have you wanted to take a text file and strip out all thr RETURN codes at the end of each line-but leave in the RETURN:RETURN at paragraph breaks?.Files that have been spooled -or come over electronic mail-are usually split into lines of about 80 characters.If you want to edit the document you need to unformat it first This program does that. First it searches for all the RETURN:RETURN's and replaces them with "ZCZC" Secondly it replaces all the remaining RETURNS with a space. Thirdly it restores the RETURN:RETURN's SEG SELECT TEXT CURSOR TOP REPEAT REPLACE "|R|R","ZCZC" UNTIL EOT CURSOR TOP REPEAT REPLACE "|R"," " UNTIL EOT CURSOR TOP REPEAT REPLACE "ZCZC","|R" UNTIL EOT CURSOR TOP DISPLAY ENDSEG NOTE:- That |R=RETURN Similarly |T=TAB |G=GREEN....f1 |W=WHITE....f2 If a document starts each line with a number of spaces as it would if using LM5,You would need to search for "|R |R" that is,|R 5 spaces|R IDEA No3...Cash Calculations If you wish to ask a question from a program in a segment you need to:- First: move the cursor to the correct place on the screen-for example the top line This can easily be done with VDU31,12,0 Note that this 'cursor' is NOT the editing cursor which is controlled by CURSOR. Second: delete the text there by overprinting with a PRINT statement. Third: Print a message asking the question Fourth: Use Get Line fron Keyboard (GLK$) to input a line of text Fifth: Convert that line to a numeric etc seg 4 VDU31,12,0 PRINT " VDU 31,12,0 PRINT "Cost in pence? "; A%=VAL GLK$ A$=STR$(A% MOD100) IF LEN A$=0 THEN A$="00" IF LEN A$=1 THEN A$="0"+A$ A$="."+A$ A$="'"+STR$(A% DIV100)+A$ TYPE A$ DISPLAY ENDSEG NOTICE also the use of PRINT & TYPE. PRINT causes output to be placed on the screen but not in the textfile, whereas TYPE will place the output in the main text. The segment can be called from the Main Text with SHIFT/f4 Since the questions asked can be varied and the users response can be held in a variable, it is possible to keep totals and so on, thus generating a variety of cash handling programs such as invoicing. It is also possible to read and write from data files, so customer numbers could be used to access name and address data whilst invoice details could be written to file. IDEA No 4 Often is is useful, or necessary, to split a large piece of text into a number of smaller files.It is easy to arrange a function key to move 'back' a file or 'forward' a file. In this program a list of files is held in segment 6, the 'back' program in segment 7 and the 'forward program in segment 8. The variable F% holds 1. F$ is used to hold the current filename SEG 6 INTRO CHAPT1 CHAPT2 CAHPT3 CHAPT4 CHAPT5 CHAPT6 INDEX ENDSEG SEG 7 REM move back one REM first save the present file REM F$ is already set up select text save text F$ REM get previous file using F% select segment 6 cursor top DOTHIS cursor down TIMES F% F$=GLT REM and load the file in LOAD text F$ select text display ENDSEG and a similar technique is used in segment 8 to move 'forward' a file This technique does work but a much more complete version of these routines is included on the cassette. VARIABLES & LABELS There are 2 types of variables; numeric & string. Numeric Variables A numeric variable must have JUST ONE UPPER CASE LETTER followed by a percent sign e.g A% or T% This means that there only 26 of them, of which it is only safe to use 24 since W% is used for the word-count & P% is used for the current page number. These variables can hold an integer between 0 & 65535 inclusive They cannot hold negative numbers They cannot hold real numbers (with a decimal point) Like BASIC these variables are always present and if one has not used them before they are set to 0. In fact, the value of these will remain if you go from Wordwise-Plus to BASIC or vice versa BUT BE WARNED; if you change to BASIC and then back again although your variables will remain your text MAY not. Note:- P% When a document is being printed, previewed or spooled P% changes with the current page.This means that as soon as you use one of these commands P% changes.Remember that P% is not reset at the start of PREVIEW, PRINT or SPOOL commands(except when performed from menu) unless preceded by a DEFAULTS command. String Variables Like numeric variables, a string variable is JUST ONE LETTER BUT FOLLOWED BY A DOLLAR($) SIGN.These are also permanently present and have a default value of "" (null string) except F$ which holds the current filename so only 25 are safe to use. Unlike numeric variables, string variables are destroyed if you enter BASIC and so cannot be transfered. Any one string can hold up to 255 characters BUT REMEMBER that for A$ through to Z$ you are limited to 613 characters or you will see 'No $ Room'.VARFREE will keep a watch for you LABELS A label is a full stop followed by a series of characters, and marks the point in the program that the computer must GOTO to.They take the place in Wordwise-Plus of BASIC's line numbers. .this_is_one .2 .&label These are all perfectly valid .but this isn't .and_this_one_would_be_longer_than_the_width_of_the_screen The first invalid one includes spaces...a label must not be followed by anything on the same line The second invalid one spans more than one line and Wordwise-Plus does not permit this for ANY program statement The only commands that jump to labels are GOTO and PROC OPERATORS There is a strict 'pecking order' for operators here listed as grouped in BBC User's Guide page 144 Group 1. brackets ? indirection operator Group 2. None in this group Group 3. * / DIV MOD Group 4. + - Group 5. = <> < > <= >= Group 6. AND Group 7. OR EOR Boolean operators AND OR EOR Can be used as logical operators or bitwise operators viz:- IF A$="YES" OR A$="yes" THEN K%=K%+1 or PRINT &66 or %00001111 Integer arithmetic operators + addition - subtraction * multiplication / division MOD modulus(remainder) DIV whole number division String operator The ONLY string operator is "+" which is used to join two strings together Comparison operators Both string & numeric values may be compared with:- = equal <> not equal < less than > greater than <= less than or equal to (not greater than) >= greater than or equal to (not less than) Indirection Operator ? is available for reading from memory only thus PRINT ?&F4 is O.K but ?&F4=11 is not Format effector The tilde character can be used to PRINT numbers in HEX but will not work in other situations, for example STR$. REMEMBER the tilde will be displayed as "~" (we're in MODE 7) Base indicators Wordwise-Plus will accept numbers in BASE PREFIX Decimal None Hexadecimal & Binary % Octal @ CHANGES FROM WORDWISE 117 1. Version number & date 2. Menu options 1 & 3 now *SAVE all text on DFS,ADFS & NFS.A side effect of this is that any markers are deleted 3. Menu options 2 & 4 now *LOAD all text from DFS,ADFS &NFS. After loading this then changes all illegal characters to ^'s 4. The word count is now held in a 16 bit integer and P% holds a copy of the page number.F$ holds the current filename. 5. CTRL/R deletes any markers in the text 6. CTRL/W causes a recount of words 7. CTRL/F toggles on screen formatting 8. It is not possible to insert a marker when there is no room 9. It is not possible to scroll down when there is no room 10.NO ROOM occurs at 4 characters free 11.When loading text, pressing ESCAPE after the filename has been entered will destroy the text 12.Loading a null file will NOT delete text 13.Menu option 2 prompts before loading text over existing text 14.Menu options 1 & 3 will ask if a file is to be overwritten. 15.The menus are tokenized to save space but are a little slower 16.Wordwise-Plus works with Aries B20 board,Watford Electronics RAM board, and the 6502 second processor 17.Beeps when asking "Marked section only" 18.Embedded command at the end of the text wil NOT now start a new page but will end the current page. 19.HP & FP are now one position different. 20.The 'event' vector is no longer used 21.There are visible page breaks 22.Default left margin is now 0 23.Error messages are now removed at the first key press 24.Menu option 8 now spools control codes 25.Get file(GF) now gets control codes 26.EM does not now send an extra carriage return on every page 27.The default footing is f1CEf2Pagef1PPf2 28.Menu option 5 allows searches for carriage returns, greens, whites and tabs 29.When printing previewing or spooling a marked section, all embedded commands up to this section are taken into account 30.Print buffer is only cleared with options 6,7 & 8 31.GF will now produce an error if it can't open a file 32.OC & ES commands can now accept alpha characters 33.All embedded command numbers can now be any valid numeric expression 34.The numbers of tab stops has been increased to 14 35.Word-count=0 if there are no words in the text 36.Search & Replace now accepts a wild card # as well as ^R,^W,^G,^T 37.Saving text on tape and pressing ESCAPE leaves the cursor at the top 38.New menu option.....No.9 39.Pressing SHIFT and a function key now runs a segment program 40.Pressing space-bar when previewing, pauses the output..another press restarts scrolling 41.PC command accepts a string expression.A literal character must be between quotes 42.NEW EMBEDDED COMMANDS * Operating system call DE Double-strike end DS Double-strike start ES Escape sequence FI Fully indent LNE Line number end LNS Line number start OPS Output sequence PA Pause PF Print file PS Print string RPS Redefine print sequence SEG Execute segment UE Underline end US Underline start REFERENCE TABLES The following is a list of commands which may be included in programs; or entered from the menus if preceded by a colon":" Under some circumstances "Can't excute" error will occur.These are commands which, if executed, would currupt or alter the running program.This includes cursor commands-i.e it is not possible to say CURSOR RIGHT if the current selected segment is the same as the one running. means the command should be followed by a numeric expression <$expr> Means the command should be followed by a string expression i.e D$ or "text in quotes" BPUT# .........DOTHIS................ CALL END CLOSE# ENDPROC CLS FIND <$expr> CURSOR RIGHT FKEY CURSOR LEFT GOTO