Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape16b_acorn_eu_1990_november.wav » R.WordWrp

R.WordWrp

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 tapes » Electron_User » Electron_User_tape16b_acorn_eu_1990_november.wav
Filename: R.WordWrp
Read OK:
File size: 0238 bytes
Load address: FFFFFB42
Exec address: FFFFC7DB
Duplicates

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

File contents
   10REM Word wrap text printer
   20REM by Sandy McAfee
   30REM (c) The Micro User
   40REM November 1990
   50MODE 7:PROCword_wrap("This is a demonstration of word wrap at a line length of 25 characters.",25)
   60PRINT:PROCword_wrap("This is a demonstration of word wrap at a line length of 35 characters.",35):END
 1000DEFPROCword_wrap(Z$,N%)
 1010S%=1:C%=N%:REPEAT
 1020B$=MID$(Z$,S%,N%):Z%=0:REPEAT
 1030Z%=Z%+1:C$=MID$(B$,Z%,1)
 1040UNTIL ASC(C$)=-1 OR Z%=N%
 1050IF ASC(C$)=-1 OR ASC(C$)=32 PRINT B$:C%=N% ELSE PROCback_peddle
 1060S%=S%+C%:UNTIL ASC(C$)=-1:ENDPROC
 1070DEFPROCback_peddle
 1080D%=0:REPEAT:D%=D%+1
 1090D$=RIGHT$(B$,D%):UNTIL ASC(D$)=32
 1100C%=N%+1-D%:B$=MID$(Z$,S%,C%)
 1110PRINT B$:ENDPROC

� Word wrap text printer
� by Sandy McAfee
� (c) The Micro User
(� November 1990
2`� 7:�word_wrap("This is a demonstration of word wrap at a line length of 25 characters.",25)
<`�:�word_wrap("This is a demonstration of word wrap at a line length of 35 characters.",35):�
���word_wrap(Z$,N%)
�S%=1:C%=N%:�
�B$=�Z$,S%,N%):Z%=0:�
Z%=Z%+1:C$=�B$,Z%,1)
� �(C$)=-1 � Z%=N%
3� �(C$)=-1 � �(C$)=32 � B$:C%=N% � �back_peddle
$S%=S%+C%:� �(C$)=-1:�
.��back_peddle
8D%=0:�:D%=D%+1
BD$=�B$,D%):� �(D$)=32
LC%=N%+1-D%:B$=�Z$,S%,C%)
V
� B$:�
�
00000000  0d 00 0a 1c f4 20 57 6f  72 64 20 77 72 61 70 20  |..... Word wrap |
00000010  74 65 78 74 20 70 72 69  6e 74 65 72 0d 00 14 15  |text printer....|
00000020  f4 20 62 79 20 53 61 6e  64 79 20 4d 63 41 66 65  |. by Sandy McAfe|
00000030  65 0d 00 1e 18 f4 20 28  63 29 20 54 68 65 20 4d  |e..... (c) The M|
00000040  69 63 72 6f 20 55 73 65  72 0d 00 28 13 f4 20 4e  |icro User..(.. N|
00000050  6f 76 65 6d 62 65 72 20  31 39 39 30 0d 00 32 60  |ovember 1990..2`|
00000060  eb 20 37 3a f2 77 6f 72  64 5f 77 72 61 70 28 22  |. 7:.word_wrap("|
00000070  54 68 69 73 20 69 73 20  61 20 64 65 6d 6f 6e 73  |This is a demons|
00000080  74 72 61 74 69 6f 6e 20  6f 66 20 77 6f 72 64 20  |tration of word |
00000090  77 72 61 70 20 61 74 20  61 20 6c 69 6e 65 20 6c  |wrap at a line l|
000000a0  65 6e 67 74 68 20 6f 66  20 32 35 20 63 68 61 72  |ength of 25 char|
000000b0  61 63 74 65 72 73 2e 22  2c 32 35 29 0d 00 3c 60  |acters.",25)..<`|
000000c0  f1 3a f2 77 6f 72 64 5f  77 72 61 70 28 22 54 68  |.:.word_wrap("Th|
000000d0  69 73 20 69 73 20 61 20  64 65 6d 6f 6e 73 74 72  |is is a demonstr|
000000e0  61 74 69 6f 6e 20 6f 66  20 77 6f 72 64 20 77 72  |ation of word wr|
000000f0  61 70 20 61 74 20 61 20  6c 69 6e 65 20 6c 65 6e  |ap at a line len|
00000100  67 74 68 20 6f 66 20 33  35 20 63 68 61 72 61 63  |gth of 35 charac|
00000110  74 65 72 73 2e 22 2c 33  35 29 3a e0 0d 03 e8 16  |ters.",35):.....|
00000120  dd f2 77 6f 72 64 5f 77  72 61 70 28 5a 24 2c 4e  |..word_wrap(Z$,N|
00000130  25 29 0d 03 f2 10 53 25  3d 31 3a 43 25 3d 4e 25  |%)....S%=1:C%=N%|
00000140  3a f5 0d 03 fc 18 42 24  3d c1 5a 24 2c 53 25 2c  |:.....B$=.Z$,S%,|
00000150  4e 25 29 3a 5a 25 3d 30  3a f5 0d 04 06 18 5a 25  |N%):Z%=0:.....Z%|
00000160  3d 5a 25 2b 31 3a 43 24  3d c1 42 24 2c 5a 25 2c  |=Z%+1:C$=.B$,Z%,|
00000170  31 29 0d 04 10 16 fd 20  97 28 43 24 29 3d 2d 31  |1)..... .(C$)=-1|
00000180  20 84 20 5a 25 3d 4e 25  0d 04 1a 33 e7 20 97 28  | . Z%=N%...3. .(|
00000190  43 24 29 3d 2d 31 20 84  20 97 28 43 24 29 3d 33  |C$)=-1 . .(C$)=3|
000001a0  32 20 f1 20 42 24 3a 43  25 3d 4e 25 20 8b 20 f2  |2 . B$:C%=N% . .|
000001b0  62 61 63 6b 5f 70 65 64  64 6c 65 0d 04 24 19 53  |back_peddle..$.S|
000001c0  25 3d 53 25 2b 43 25 3a  fd 20 97 28 43 24 29 3d  |%=S%+C%:. .(C$)=|
000001d0  2d 31 3a e1 0d 04 2e 11  dd f2 62 61 63 6b 5f 70  |-1:.......back_p|
000001e0  65 64 64 6c 65 0d 04 38  12 44 25 3d 30 3a f5 3a  |eddle..8.D%=0:.:|
000001f0  44 25 3d 44 25 2b 31 0d  04 42 19 44 24 3d c2 42  |D%=D%+1..B.D$=.B|
00000200  24 2c 44 25 29 3a fd 20  97 28 44 24 29 3d 33 32  |$,D%):. .(D$)=32|
00000210  0d 04 4c 1c 43 25 3d 4e  25 2b 31 2d 44 25 3a 42  |..L.C%=N%+1-D%:B|
00000220  24 3d c1 5a 24 2c 53 25  2c 43 25 29 0d 04 56 0a  |$=.Z$,S%,C%)..V.|
00000230  f1 20 42 24 3a e1 0d ff                           |. B$:...|
00000238
R.WordWrp.m0
R.WordWrp.m1
R.WordWrp.m2
R.WordWrp.m4
R.WordWrp.m5