Home » Archimedes archive » Acorn User » AU 1994-03.adf » !BasicProg_BasicProg » Listing1

Listing1

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 » Acorn User » AU 1994-03.adf » !BasicProg_BasicProg
Filename: Listing1
Read OK:
File size: 018E bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Listing1
   20:
   30ON ERROR REPORT:PRINT " at line ";ERL/10:END
   40MODE 0
   50INPUT "Please enter a full filename",f$
   60PRINT "Filename = ";FNfilename(f$)
   70PRINT "Pathname = ";FNpathname(f$)
   80END
   90:
  100DEF FNfilename(file$)
  110temp%=0
  120REPEAT
  130 pos%=temp%+1
  140 temp%=INSTR(file$,".",pos%)
  150UNTIL temp%=0
  160=MID$(file$,pos%)
  170:
  180DEF FNpathname(file$)
  190filelen%=LEN(FNfilename(file$))
  200pathlen%=LEN(file$)-filelen%-1
  210=LEFT$(file$,pathlen%)

� >Listing1
:
� � �:� " at line ";�/10:�
(� 0
2'� "Please enter a full filename",f$
<!� "Filename = ";�filename(f$)
F!� "Pathname = ";�pathname(f$)
P�
Z:
d� �filename(file$)
ntemp%=0
x�
� pos%=temp%+1
� temp%=�file$,".",pos%)
�
� temp%=0
�=�file$,pos%)
�:
�� �pathname(file$)
� filelen%=�(�filename(file$))
� pathlen%=�(file$)-filelen%-1
�=�file$,pathlen%)
�
00000000  0d 00 0a 0f f4 20 3e 4c  69 73 74 69 6e 67 31 0d  |..... >Listing1.|
00000010  00 14 05 3a 0d 00 1e 1e  ee 20 85 20 f6 3a f1 20  |...:..... . .:. |
00000020  22 20 61 74 20 6c 69 6e  65 20 22 3b 9e 2f 31 30  |" at line ";./10|
00000030  3a e0 0d 00 28 07 eb 20  30 0d 00 32 27 e8 20 22  |:...(.. 0..2'. "|
00000040  50 6c 65 61 73 65 20 65  6e 74 65 72 20 61 20 66  |Please enter a f|
00000050  75 6c 6c 20 66 69 6c 65  6e 61 6d 65 22 2c 66 24  |ull filename",f$|
00000060  0d 00 3c 21 f1 20 22 46  69 6c 65 6e 61 6d 65 20  |..<!. "Filename |
00000070  3d 20 22 3b a4 66 69 6c  65 6e 61 6d 65 28 66 24  |= ";.filename(f$|
00000080  29 0d 00 46 21 f1 20 22  50 61 74 68 6e 61 6d 65  |)..F!. "Pathname|
00000090  20 3d 20 22 3b a4 70 61  74 68 6e 61 6d 65 28 66  | = ";.pathname(f|
000000a0  24 29 0d 00 50 05 e0 0d  00 5a 05 3a 0d 00 64 16  |$)..P....Z.:..d.|
000000b0  dd 20 a4 66 69 6c 65 6e  61 6d 65 28 66 69 6c 65  |. .filename(file|
000000c0  24 29 0d 00 6e 0b 74 65  6d 70 25 3d 30 0d 00 78  |$)..n.temp%=0..x|
000000d0  05 f5 0d 00 82 11 20 70  6f 73 25 3d 74 65 6d 70  |...... pos%=temp|
000000e0  25 2b 31 0d 00 8c 1b 20  74 65 6d 70 25 3d a7 66  |%+1.... temp%=.f|
000000f0  69 6c 65 24 2c 22 2e 22  2c 70 6f 73 25 29 0d 00  |ile$,".",pos%)..|
00000100  96 0d fd 20 74 65 6d 70  25 3d 30 0d 00 a0 11 3d  |... temp%=0....=|
00000110  c1 66 69 6c 65 24 2c 70  6f 73 25 29 0d 00 aa 05  |.file$,pos%)....|
00000120  3a 0d 00 b4 16 dd 20 a4  70 61 74 68 6e 61 6d 65  |:..... .pathname|
00000130  28 66 69 6c 65 24 29 0d  00 be 20 66 69 6c 65 6c  |(file$)... filel|
00000140  65 6e 25 3d a9 28 a4 66  69 6c 65 6e 61 6d 65 28  |en%=.(.filename(|
00000150  66 69 6c 65 24 29 29 0d  00 c8 20 70 61 74 68 6c  |file$))... pathl|
00000160  65 6e 25 3d a9 28 66 69  6c 65 24 29 2d 66 69 6c  |en%=.(file$)-fil|
00000170  65 6c 65 6e 25 2d 31 0d  00 d2 15 3d c0 66 69 6c  |elen%-1....=.fil|
00000180  65 24 2c 70 61 74 68 6c  65 6e 25 29 0d ff        |e$,pathlen%)..|
0000018e