Tascount - Malcolm Paknadel (Your Spectrum-Issue 15-Page 64)


Tasword II's a great word processing package but it would be even
better with a word count routine. Well, now it's got one - Tascount
and it only takes up 60 bytes.
        Tascount searches for any character preceded by a space, a
graphic character, or a new line and treats this as a new word. It also
takes into account right justification and hyphenated words.
        To enter the code, first type in the Basic loader program. When
RUN, you'll be prompted for a sequence of five numbers followed
by a checksum. If your checksum is wrong you'll be given a second
chance. The machine code will be saved as a file called "TasCount".
        Load Tasword as normal and then exit into Basic. Next you've
got to edit lines 10 and 25 as directed. Now type 'LOAD "TasCount"
CODE', and load up the machine code. Tascount's now incorporated
into Tasword and the only difference you'll notice is the word
count and text file size in lines and bytes at the foot of the screen.
All you've got to do is press 'STOP' to exit from the text file and
wait just two seconds. And we got that time on a 19K file - not bad, eh?
        Of course, you can always make your own amendments so that
Tascount adds just what you want to Tasword. For example, if
you're using a shorter text file size, say with TASPRINT, then
change the 205 in line 12 of the machine code dump to the highest
page boundary that'll completely enclose the text file. So, if the text
file ends at address END, change 205 to INT(END/256+1).
        You can count on YS readers to come up with the best software
ideas!


[...]
This is the machine code loader program.
[See "TasHexload" on TASCOUNT.TAP]


ADDRESS DATA                    CHECKSUM
58420:  33,0,125,1,0            159
58425:  0,89,125,230,63         507
58430:  194,72,228,62,2         558
58435:  163,194,72,228,95       752
58440:  126,254,33,56,9         478
58445:  254,45,40,12,254        605
58450:  128,218,98,228,123      795
58455:  230,2,95,195,106        628
58460:  228,203,35,195,106      767
58465:  228,123,30,1,167        549
58470:  194,106,228,3,35        566
58475:  124,254,205,194,59      836
58480:  228,201,201,201,201     1032

This is the machine code dump. If you don't want to have graphic
characters as delimiters, change the 128 in line 7 of the machine
code dump to a 255 and add 127 to the checksum value at the end
of the line.


--------------------------------
  10 CLS : LET a=USR 64330: LET
wc=USR 58420: GO TO 20
  25 PRINT #0;"WORDS=";wc;TAB 11
;"LINES=";INT (a/PEEK 62237+.5);
TAB 21;"BYTES=";a: GO SUB 4000: 
PRINT AT 4,0;"print text file   
             p"

These are the alterations you have to make to Tasword so that it
can give the word count option.

------------------------------------------------------------------------------
TYPE: Utility 

COMMENT: 


This info file was typed by Jim Grimwood

Downloaded from:
Desert Island Disks -- http://www.image.dk/~frankie/
Maintained by:
Michael Bruhn -- frankie@image.dk
