Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_39.ADF » P/TESTER

P/TESTER

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_39.ADF
Filename: P/TESTER
Read OK:
File size: 0397 bytes
Load address: FFFFFF48
Exec address: 12D8F
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
Demo file showing the wordwrapper

=================================

Say we have a block of text which was written in 80 column mode,but we want to show this is 40 column mode instead.A crude way to do this would be simply to print it out unmodified,but this would result in some words being broken across the ends of lines.It is therefore desireable to wordwrap the text.This may be done by considering some special cases.


To do this - if you find a character LESS THAN or EQUAL TO 13 then a newline is printed,then,you look ahead one byte to see if that is also LESS THAN or EQUAL TO 13,but NOT the same as the other.This then takes into account people who wanted two empty lines one after another in their text.Discard the second byte if it IS different.




012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123


00000000  44 65 6d 6f 20 66 69 6c  65 20 73 68 6f 77 69 6e  |Demo file showin|
00000010  67 20 74 68 65 20 77 6f  72 64 77 72 61 70 70 65  |g the wordwrappe|
00000020  72 0a 0d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |r..=============|
00000030  3d 3d 3d 3d 3d 3d 3d 3d  3d 3d 3d 3d 3d 3d 3d 3d  |================|
00000040  3d 3d 3d 3d 0a 0d 53 61  79 20 77 65 20 68 61 76  |====..Say we hav|
00000050  65 20 61 20 62 6c 6f 63  6b 20 6f 66 20 74 65 78  |e a block of tex|
00000060  74 20 77 68 69 63 68 20  77 61 73 20 77 72 69 74  |t which was writ|
00000070  74 65 6e 20 69 6e 20 38  30 20 63 6f 6c 75 6d 6e  |ten in 80 column|
00000080  20 6d 6f 64 65 2c 62 75  74 20 77 65 20 77 61 6e  | mode,but we wan|
00000090  74 20 74 6f 20 73 68 6f  77 20 74 68 69 73 20 69  |t to show this i|
000000a0  73 20 34 30 20 63 6f 6c  75 6d 6e 20 6d 6f 64 65  |s 40 column mode|
000000b0  20 69 6e 73 74 65 61 64  2e 41 20 63 72 75 64 65  | instead.A crude|
000000c0  20 77 61 79 20 74 6f 20  64 6f 20 74 68 69 73 20  | way to do this |
000000d0  77 6f 75 6c 64 20 62 65  20 73 69 6d 70 6c 79 20  |would be simply |
000000e0  74 6f 20 70 72 69 6e 74  20 69 74 20 6f 75 74 20  |to print it out |
000000f0  75 6e 6d 6f 64 69 66 69  65 64 2c 62 75 74 20 74  |unmodified,but t|
00000100  68 69 73 20 77 6f 75 6c  64 20 72 65 73 75 6c 74  |his would result|
00000110  20 69 6e 20 73 6f 6d 65  20 77 6f 72 64 73 20 62  | in some words b|
00000120  65 69 6e 67 20 62 72 6f  6b 65 6e 20 61 63 72 6f  |eing broken acro|
00000130  73 73 20 74 68 65 20 65  6e 64 73 20 6f 66 20 6c  |ss the ends of l|
00000140  69 6e 65 73 2e 49 74 20  69 73 20 74 68 65 72 65  |ines.It is there|
00000150  66 6f 72 65 20 64 65 73  69 72 65 61 62 6c 65 20  |fore desireable |
00000160  74 6f 20 77 6f 72 64 77  72 61 70 20 74 68 65 20  |to wordwrap the |
00000170  74 65 78 74 2e 54 68 69  73 20 6d 61 79 20 62 65  |text.This may be|
00000180  20 64 6f 6e 65 20 62 79  20 63 6f 6e 73 69 64 65  | done by conside|
00000190  72 69 6e 67 20 73 6f 6d  65 20 73 70 65 63 69 61  |ring some specia|
000001a0  6c 20 63 61 73 65 73 2e  0a 0d 0a 0d 54 6f 20 64  |l cases.....To d|
000001b0  6f 20 74 68 69 73 20 2d  20 69 66 20 79 6f 75 20  |o this - if you |
000001c0  66 69 6e 64 20 61 20 63  68 61 72 61 63 74 65 72  |find a character|
000001d0  20 4c 45 53 53 20 54 48  41 4e 20 6f 72 20 45 51  | LESS THAN or EQ|
000001e0  55 41 4c 20 54 4f 20 31  33 20 74 68 65 6e 20 61  |UAL TO 13 then a|
000001f0  20 6e 65 77 6c 69 6e 65  20 69 73 20 70 72 69 6e  | newline is prin|
00000200  74 65 64 2c 74 68 65 6e  2c 79 6f 75 20 6c 6f 6f  |ted,then,you loo|
00000210  6b 20 61 68 65 61 64 20  6f 6e 65 20 62 79 74 65  |k ahead one byte|
00000220  20 74 6f 20 73 65 65 20  69 66 20 74 68 61 74 20  | to see if that |
00000230  69 73 20 61 6c 73 6f 20  4c 45 53 53 20 54 48 41  |is also LESS THA|
00000240  4e 20 6f 72 20 45 51 55  41 4c 20 54 4f 20 31 33  |N or EQUAL TO 13|
00000250  2c 62 75 74 20 4e 4f 54  20 74 68 65 20 73 61 6d  |,but NOT the sam|
00000260  65 20 61 73 20 74 68 65  20 6f 74 68 65 72 2e 54  |e as the other.T|
00000270  68 69 73 20 74 68 65 6e  20 74 61 6b 65 73 20 69  |his then takes i|
00000280  6e 74 6f 20 61 63 63 6f  75 6e 74 20 70 65 6f 70  |nto account peop|
00000290  6c 65 20 77 68 6f 20 77  61 6e 74 65 64 20 74 77  |le who wanted tw|
000002a0  6f 20 65 6d 70 74 79 20  6c 69 6e 65 73 20 6f 6e  |o empty lines on|
000002b0  65 20 61 66 74 65 72 20  61 6e 6f 74 68 65 72 20  |e after another |
000002c0  69 6e 20 74 68 65 69 72  20 74 65 78 74 2e 44 69  |in their text.Di|
000002d0  73 63 61 72 64 20 74 68  65 20 73 65 63 6f 6e 64  |scard the second|
000002e0  20 62 79 74 65 20 69 66  20 69 74 20 49 53 20 64  | byte if it IS d|
000002f0  69 66 66 65 72 65 6e 74  2e 0a 0d 0a 0d 0a 0d 0a  |ifferent........|
00000300  0d 0a 30 31 32 33 34 35  36 37 38 39 30 31 32 33  |..01234567890123|
00000310  34 35 36 37 38 39 30 31  32 33 34 35 36 37 38 39  |4567890123456789|
00000320  30 31 32 33 34 35 36 37  38 39 30 31 32 33 34 35  |0123456789012345|
00000330  36 37 38 39 30 31 32 33  34 35 36 37 38 39 30 31  |6789012345678901|
00000340  32 33 34 35 36 37 38 39  30 31 32 33 34 35 36 37  |2345678901234567|
00000350  38 39 30 31 32 33 34 35  36 37 38 39 30 31 32 33  |8901234567890123|
00000360  34 35 36 37 38 39 30 31  32 33 34 35 36 37 38 39  |4567890123456789|
00000370  30 31 32 33 34 35 36 37  38 39 30 31 32 33 34 35  |0123456789012345|
00000380  36 37 38 39 30 31 32 33  34 35 36 37 38 39 30 31  |6789012345678901|
00000390  32 33 0a 0d 0a 0d 00                              |23.....|
00000397
P/TESTER.m0
P/TESTER.m1
P/TESTER.m2
P/TESTER.m4
P/TESTER.m5