home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1996
/
ARCHIVE_96.iso
/
discs
/
mag_discs
/
volume_9
/
issue_02
/
keystroke
/
_xxxSTRIP
(
.txt
)
next >
Wrap
RISC OS BBC BASIC V Source
|
1995-09-07
|
2KB
|
90 lines
(V1.01) Reads pathname/name for a DOS tag and outputs the correct filetype (if found).
if the last char is an 'a' then the file is auto translated for you
(if you supplied a full pathname)
"OS_GetEnv"
command%
!command$=
getstring(command%)
3text$=
command$,
(command$)-
command$,""" ")-1)
ks_option%=0
text$)="a"
ks_option%=1
text$=
text$,
(text$)-1)
pos%=
text$,"/")-1
pos%<=0
origtext$=
text$,pos%)
dos_tag$=
text$,pos%+2)
IF LEN(dos_tag$)<>3 THEN QUIT
+dos_tag$=
conver_to_uppercase(dos_tag$)
number_of_pairs
flag%=
loop = 1
number_of_pairs
datatag$,riscos$
dos_tag$=datatag$
loop=number_of_pairs
flag%=
flag%=
("Set KS$Line "+origtext$)
("Set KS$filetype FE4")
riscos$="FE4"
("Set KS$Line "+origtext$)
("Set KS$filetype "+riscos$)
ks_option%=1
text$,"::") >0
"OS_File",5,origtext$
found%
found%=0
/'
("Rename "+text$+" "+origtext$)
1" origtext$=origtext$+
found%=0
("Settype "+origtext$+" "+riscos$)
This number is the total number of pairs of DOS/RISCOS pairs,if you add or delete
any you will have to manually alter this number as well.
This data list consists of pairs of DOS to RISCOS filetype tags.
First DOS (ARJ) and then RISCOS (DDC).
You should be able to add your only very easily.
ARJ,DDC,AVI,FB2,BAT,FDA,BIN,FFD,BMP,69C,COM,FD8,DIB,69C,DOC,FFF,EXE,FD9,EPS,FF5
GIF,695,IFF,693,LBM,693,HBR,693,HAM,693,HTM,823,JIF,C85,JPG,C85,PBM,69E,IMG,692
MAC,694,MOD,CB6,MOV,FB2,MPG,BF8,PCD,BE8,PCI,BE8,PCX,697,PCC,697,SEP,FF0,TIF,FF0
PPM,69E,PGM,69E,PNM,69E,QRT,698,RAS,FC9,SUN,FC9,TXT,FFF,CMY,FF0,TGA,69D,VDA,69D
ICB,69D,BST,69D,WAV,FB1,AIF,FB1,ZIP,DDC,PCT,FD5,PNT,694,RIX,6A2,SCF,6A2,SCI,6A2
FLI,B9F,FLC,B9F,ICO,BBB,VOC,FB1
getstring(ptr%)
I p$=""
(?ptr%>31
?ptr%<256)
(p$)<255
c%=?ptr%
p$+=
ptr%+=1
conver_to_uppercase(str$)
ntext$=""
loop%=1
(str$)
str$,loop%,1))
a% >= 65
a% <= 122
(a%
32) = 32
a%> 64
a%<123
a%=a%-32
a%>223
a%<255
a%=a%-32
a%=34
("|")
ntext$+=
=ntext$