Home » Archimedes archive » Zipped Apps » 1st Word Plus » WP/utils/Convertext

WP/utils/Convertext

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 » Archimedes archive » Zipped Apps » 1st Word Plus
Filename: WP/utils/Convertext
Read OK:
File size: 05BB bytes
Load address: 0000
Exec address: 0000
File contents
   10REM>Convertext
   20MODE3:ON ERROR VDU7:CLOSE#0:END
   30PRINT''"Converting ASCII text file to a format which may be input to '1st Word Plus'"
   40PRINT'"Single <CR> or <CR>+<LF> are removed and replaced by <*>"'"Double <CR> or <CR>+<LF> are increased to triple"'"All <SPC> are replaced by <*>"
   50INPUT'"Enter input filename: "in$
   60INPUT'"Enter output filename: "out$
   70IF out$=in$ PRINT"You can't use the same names":GOTO 60
   80in%=OPENIN(in$):out%=OPENOUT(out$)
   90WHILE NOT EOF#in%
  100n%=BGET#in%:REM                                          read a character
  110IF n%=13 THEN
  120GOSUB 270:REM                                              branch if <CR>
  130ELSE
  140IF n%=32 n%=42:REM                              convert hard <SPC> to <*>
  150BPUT#out%,n%:REM                                               write char
  160ENDIF
  170ENDWHILE
  180BPUT#out%,13:BPUT#out%,10:REM                       write final <CR>+<LF>
  190CLOSE#0
  200PRINT'"Finished conversion"''out$" can be 'OPENed' in '1st Word Plus', then:"'
  210PRINT"   1.  Select WP mode ON (Edit Menu)"
  220PRINT"   2.  Replace <*> with <SPC> (use 'SOME' & ignore erors)"
  230PRINT"   3.  Repeatedly and alternately reformat (F12) and delete the"'"       hidden <CR> at the ends of the 160-char. lines"
  240PRINT"   4.  You should now be able to edit the document as normal!"'
  250END
  260:
  270IF NOT EOF#in% m%=BGET#in%
  280IF m%=10 OR m%=32 OR m%=9 THEN 270:REM       discard <LF>, <SPC> or <TAB>
  290IF m%=13 THEN
  300FOR z%=1 TO 3:BPUT#out%,13:BPUT#out%,10:NEXT:REM      write 3 x <CR>+<LF>
  310ELSE
  320BPUT#out%,42:BPUT#out%,m%:REM                            write <*>+<char>
  330ENDIF
  340RETURN

�>Convertext
�3:� � �7:�#0:�
U�''"Converting ASCII text file to a format which may be input to '1st Word Plus'"
(��'"Single <CR> or <CR>+<LF> are removed and replaced by <*>"'"Double <CR> or <CR>+<LF> are increased to triple"'"All <SPC> are replaced by <*>"
2!�'"Enter input filename: "in$
<#�'"Enter output filename: "out$
F5� out$=in$ �"You can't use the same names":� �T|@
Pin%=�(in$):out%=�(out$)
Zȕ � �#in%
dHn%=�#in%:�                                          read a character
n
� n%=13 �
xH� �TNA:�                                              branch if <CR>
��
�J� n%=32 n%=42:�                              convert hard <SPC> to <*>
�H�#out%,n%:�                                               write char
��
��
�E�#out%,13:�#out%,10:�                       write final <CR>+<LF>
��#0
�N�'"Finished conversion"''out$" can be 'OPENed' in '1st Word Plus', then:"'
�+�"   1.  Select WP mode ON (Edit Menu)"
�@�"   2.  Replace <*> with <SPC> (use 'SOME' & ignore erors)"
�~�"   3.  Repeatedly and alternately reformat (F12) and delete the"'"       hidden <CR> at the ends of the 160-char. lines"
�E�"   4.  You should now be able to edit the document as normal!"'
��
:
� � �#in% m%=�#in%
F� m%=10 � m%=32 � m%=9 � �TNA:�       discard <LF>, <SPC> or <TAB>
"
� m%=13 �
,?� z%=1 � 3:�#out%,13:�#out%,10:�:�      write 3 x <CR>+<LF>
6�
@E�#out%,42:�#out%,m%:�                            write <*>+<char>
J�
T�
�
00000000  0d 00 0a 10 f4 3e 43 6f  6e 76 65 72 74 65 78 74  |.....>Convertext|
00000010  0d 00 14 13 eb 33 3a ee  20 85 20 ef 37 3a d9 23  |.....3:. . .7:.#|
00000020  30 3a e0 0d 00 1e 55 f1  27 27 22 43 6f 6e 76 65  |0:....U.''"Conve|
00000030  72 74 69 6e 67 20 41 53  43 49 49 20 74 65 78 74  |rting ASCII text|
00000040  20 66 69 6c 65 20 74 6f  20 61 20 66 6f 72 6d 61  | file to a forma|
00000050  74 20 77 68 69 63 68 20  6d 61 79 20 62 65 20 69  |t which may be i|
00000060  6e 70 75 74 20 74 6f 20  27 31 73 74 20 57 6f 72  |nput to '1st Wor|
00000070  64 20 50 6c 75 73 27 22  0d 00 28 93 f1 27 22 53  |d Plus'"..(..'"S|
00000080  69 6e 67 6c 65 20 3c 43  52 3e 20 6f 72 20 3c 43  |ingle <CR> or <C|
00000090  52 3e 2b 3c 4c 46 3e 20  61 72 65 20 72 65 6d 6f  |R>+<LF> are remo|
000000a0  76 65 64 20 61 6e 64 20  72 65 70 6c 61 63 65 64  |ved and replaced|
000000b0  20 62 79 20 3c 2a 3e 22  27 22 44 6f 75 62 6c 65  | by <*>"'"Double|
000000c0  20 3c 43 52 3e 20 6f 72  20 3c 43 52 3e 2b 3c 4c  | <CR> or <CR>+<L|
000000d0  46 3e 20 61 72 65 20 69  6e 63 72 65 61 73 65 64  |F> are increased|
000000e0  20 74 6f 20 74 72 69 70  6c 65 22 27 22 41 6c 6c  | to triple"'"All|
000000f0  20 3c 53 50 43 3e 20 61  72 65 20 72 65 70 6c 61  | <SPC> are repla|
00000100  63 65 64 20 62 79 20 3c  2a 3e 22 0d 00 32 21 e8  |ced by <*>"..2!.|
00000110  27 22 45 6e 74 65 72 20  69 6e 70 75 74 20 66 69  |'"Enter input fi|
00000120  6c 65 6e 61 6d 65 3a 20  22 69 6e 24 0d 00 3c 23  |lename: "in$..<#|
00000130  e8 27 22 45 6e 74 65 72  20 6f 75 74 70 75 74 20  |.'"Enter output |
00000140  66 69 6c 65 6e 61 6d 65  3a 20 22 6f 75 74 24 0d  |filename: "out$.|
00000150  00 46 35 e7 20 6f 75 74  24 3d 69 6e 24 20 f1 22  |.F5. out$=in$ ."|
00000160  59 6f 75 20 63 61 6e 27  74 20 75 73 65 20 74 68  |You can't use th|
00000170  65 20 73 61 6d 65 20 6e  61 6d 65 73 22 3a e5 20  |e same names":. |
00000180  8d 54 7c 40 0d 00 50 1b  69 6e 25 3d 8e 28 69 6e  |.T|@..P.in%=.(in|
00000190  24 29 3a 6f 75 74 25 3d  ae 28 6f 75 74 24 29 0d  |$):out%=.(out$).|
000001a0  00 5a 0e c8 95 20 ac 20  c5 23 69 6e 25 0d 00 64  |.Z... . .#in%..d|
000001b0  48 6e 25 3d 9a 23 69 6e  25 3a f4 20 20 20 20 20  |Hn%=.#in%:.     |
000001c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000001e0  20 20 20 20 20 72 65 61  64 20 61 20 63 68 61 72  |     read a char|
000001f0  61 63 74 65 72 0d 00 6e  0d e7 20 6e 25 3d 31 33  |acter..n.. n%=13|
00000200  20 8c 0d 00 78 48 e4 20  8d 54 4e 41 3a f4 20 20  | ...xH. .TNA:.  |
00000210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000230  20 20 20 20 20 20 20 20  20 20 20 20 62 72 61 6e  |            bran|
00000240  63 68 20 69 66 20 3c 43  52 3e 0d 00 82 05 cc 0d  |ch if <CR>......|
00000250  00 8c 4a e7 20 6e 25 3d  33 32 20 6e 25 3d 34 32  |..J. n%=32 n%=42|
00000260  3a f4 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |:.              |
00000270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000280  63 6f 6e 76 65 72 74 20  68 61 72 64 20 3c 53 50  |convert hard <SP|
00000290  43 3e 20 74 6f 20 3c 2a  3e 0d 00 96 48 d5 23 6f  |C> to <*>...H.#o|
000002a0  75 74 25 2c 6e 25 3a f4  20 20 20 20 20 20 20 20  |ut%,n%:.        |
000002b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000002d0  20 20 20 20 20 20 20 77  72 69 74 65 20 63 68 61  |       write cha|
000002e0  72 0d 00 a0 05 cd 0d 00  aa 05 ce 0d 00 b4 45 d5  |r.............E.|
000002f0  23 6f 75 74 25 2c 31 33  3a d5 23 6f 75 74 25 2c  |#out%,13:.#out%,|
00000300  31 30 3a f4 20 20 20 20  20 20 20 20 20 20 20 20  |10:.            |
00000310  20 20 20 20 20 20 20 20  20 20 20 77 72 69 74 65  |           write|
00000320  20 66 69 6e 61 6c 20 3c  43 52 3e 2b 3c 4c 46 3e  | final <CR>+<LF>|
00000330  0d 00 be 07 d9 23 30 0d  00 c8 4e f1 27 22 46 69  |.....#0...N.'"Fi|
00000340  6e 69 73 68 65 64 20 63  6f 6e 76 65 72 73 69 6f  |nished conversio|
00000350  6e 22 27 27 6f 75 74 24  22 20 63 61 6e 20 62 65  |n"''out$" can be|
00000360  20 27 4f 50 45 4e 65 64  27 20 69 6e 20 27 31 73  | 'OPENed' in '1s|
00000370  74 20 57 6f 72 64 20 50  6c 75 73 27 2c 20 74 68  |t Word Plus', th|
00000380  65 6e 3a 22 27 0d 00 d2  2b f1 22 20 20 20 31 2e  |en:"'...+."   1.|
00000390  20 20 53 65 6c 65 63 74  20 57 50 20 6d 6f 64 65  |  Select WP mode|
000003a0  20 4f 4e 20 28 45 64 69  74 20 4d 65 6e 75 29 22  | ON (Edit Menu)"|
000003b0  0d 00 dc 40 f1 22 20 20  20 32 2e 20 20 52 65 70  |...@."   2.  Rep|
000003c0  6c 61 63 65 20 3c 2a 3e  20 77 69 74 68 20 3c 53  |lace <*> with <S|
000003d0  50 43 3e 20 28 75 73 65  20 27 53 4f 4d 45 27 20  |PC> (use 'SOME' |
000003e0  26 20 69 67 6e 6f 72 65  20 65 72 6f 72 73 29 22  |& ignore erors)"|
000003f0  0d 00 e6 7e f1 22 20 20  20 33 2e 20 20 52 65 70  |...~."   3.  Rep|
00000400  65 61 74 65 64 6c 79 20  61 6e 64 20 61 6c 74 65  |eatedly and alte|
00000410  72 6e 61 74 65 6c 79 20  72 65 66 6f 72 6d 61 74  |rnately reformat|
00000420  20 28 46 31 32 29 20 61  6e 64 20 64 65 6c 65 74  | (F12) and delet|
00000430  65 20 74 68 65 22 27 22  20 20 20 20 20 20 20 68  |e the"'"       h|
00000440  69 64 64 65 6e 20 3c 43  52 3e 20 61 74 20 74 68  |idden <CR> at th|
00000450  65 20 65 6e 64 73 20 6f  66 20 74 68 65 20 31 36  |e ends of the 16|
00000460  30 2d 63 68 61 72 2e 20  6c 69 6e 65 73 22 0d 00  |0-char. lines"..|
00000470  f0 45 f1 22 20 20 20 34  2e 20 20 59 6f 75 20 73  |.E."   4.  You s|
00000480  68 6f 75 6c 64 20 6e 6f  77 20 62 65 20 61 62 6c  |hould now be abl|
00000490  65 20 74 6f 20 65 64 69  74 20 74 68 65 20 64 6f  |e to edit the do|
000004a0  63 75 6d 65 6e 74 20 61  73 20 6e 6f 72 6d 61 6c  |cument as normal|
000004b0  21 22 27 0d 00 fa 05 e0  0d 01 04 05 3a 0d 01 0e  |!"'.........:...|
000004c0  16 e7 20 ac 20 c5 23 69  6e 25 20 6d 25 3d 9a 23  |.. . .#in% m%=.#|
000004d0  69 6e 25 0d 01 18 46 e7  20 6d 25 3d 31 30 20 84  |in%...F. m%=10 .|
000004e0  20 6d 25 3d 33 32 20 84  20 6d 25 3d 39 20 8c 20  | m%=32 . m%=9 . |
000004f0  8d 54 4e 41 3a f4 20 20  20 20 20 20 20 64 69 73  |.TNA:.       dis|
00000500  63 61 72 64 20 3c 4c 46  3e 2c 20 3c 53 50 43 3e  |card <LF>, <SPC>|
00000510  20 6f 72 20 3c 54 41 42  3e 0d 01 22 0d e7 20 6d  | or <TAB>..".. m|
00000520  25 3d 31 33 20 8c 0d 01  2c 3f e3 20 7a 25 3d 31  |%=13 ...,?. z%=1|
00000530  20 b8 20 33 3a d5 23 6f  75 74 25 2c 31 33 3a d5  | . 3:.#out%,13:.|
00000540  23 6f 75 74 25 2c 31 30  3a ed 3a f4 20 20 20 20  |#out%,10:.:.    |
00000550  20 20 77 72 69 74 65 20  33 20 78 20 3c 43 52 3e  |  write 3 x <CR>|
00000560  2b 3c 4c 46 3e 0d 01 36  05 cc 0d 01 40 45 d5 23  |+<LF>..6....@E.#|
00000570  6f 75 74 25 2c 34 32 3a  d5 23 6f 75 74 25 2c 6d  |out%,42:.#out%,m|
00000580  25 3a f4 20 20 20 20 20  20 20 20 20 20 20 20 20  |%:.             |
00000590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 77  |               w|
000005a0  72 69 74 65 20 3c 2a 3e  2b 3c 63 68 61 72 3e 0d  |rite <*>+<char>.|
000005b0  01 4a 05 cd 0d 01 54 05  f8 0d ff                 |.J....T....|
000005bb