home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / mag_discs / volume_9 / issue_02 / keystroke / _xxxSTRIP (.txt) next >
RISC OS BBC BASIC V Source  |  1995-09-07  |  2KB  |  90 lines

  1.  (V1.01) Reads pathname/name for a DOS tag and outputs the correct filetype (if found).
  2.  if the last char is an 'a' then the file is auto translated for you
  3.  (if you supplied a full pathname)
  4.  "OS_GetEnv" 
  5.  command%
  6. !command$=
  7. getstring(command%)
  8. 3text$=
  9. command$,
  10. (command$)-
  11. command$,""" ")-1)
  12. ks_option%=0
  13. text$)="a" 
  14.  ks_option%=1
  15.  text$=
  16. text$,
  17. (text$)-1)
  18. pos%=
  19. text$,"/")-1
  20.  pos%<=0 
  21. origtext$=
  22. text$,pos%)
  23. dos_tag$=
  24. text$,pos%+2)
  25.  IF LEN(dos_tag$)<>3 THEN QUIT
  26. +dos_tag$=
  27. conver_to_uppercase(dos_tag$)
  28.  number_of_pairs
  29. flag%=
  30.  loop = 1 
  31.  number_of_pairs
  32.  datatag$,riscos$
  33.  dos_tag$=datatag$ 
  34.   loop=number_of_pairs
  35.   flag%=
  36.  flag%=
  37. ("Set KS$Line "+origtext$)
  38. ("Set KS$filetype FE4")
  39.  riscos$="FE4"
  40. ("Set KS$Line "+origtext$)
  41. ("Set KS$filetype "+riscos$)
  42.  ks_option%=1 
  43. text$,"::") >0 
  44.  "OS_File",5,origtext$ 
  45.  found%
  46.  found%=0 
  47. /'   
  48. ("Rename "+text$+" "+origtext$)
  49. 1"   origtext$=origtext$+
  50.  found%=0
  51. ("Settype "+origtext$+" "+riscos$)
  52.  This number is the total number of pairs of DOS/RISCOS pairs,if you add or delete
  53.  any you will have to manually alter this number as well.
  54.  This data list consists of pairs of DOS to RISCOS filetype tags.
  55.  First DOS (ARJ) and then RISCOS (DDC).
  56.  You should be able to add your only very easily.
  57.  ARJ,DDC,AVI,FB2,BAT,FDA,BIN,FFD,BMP,69C,COM,FD8,DIB,69C,DOC,FFF,EXE,FD9,EPS,FF5
  58.  GIF,695,IFF,693,LBM,693,HBR,693,HAM,693,HTM,823,JIF,C85,JPG,C85,PBM,69E,IMG,692
  59.  MAC,694,MOD,CB6,MOV,FB2,MPG,BF8,PCD,BE8,PCI,BE8,PCX,697,PCC,697,SEP,FF0,TIF,FF0
  60.  PPM,69E,PGM,69E,PNM,69E,QRT,698,RAS,FC9,SUN,FC9,TXT,FFF,CMY,FF0,TGA,69D,VDA,69D
  61.  ICB,69D,BST,69D,WAV,FB1,AIF,FB1,ZIP,DDC,PCT,FD5,PNT,694,RIX,6A2,SCF,6A2,SCI,6A2
  62.  FLI,B9F,FLC,B9F,ICO,BBB,VOC,FB1
  63. getstring(ptr%)
  64. I    p$=""
  65.  (?ptr%>31 
  66.  ?ptr%<256) 
  67. (p$)<255
  68.   c%=?ptr%
  69.   p$+=
  70.   ptr%+=1
  71. conver_to_uppercase(str$)
  72. ntext$=""
  73.  loop%=1 
  74. (str$)
  75. str$,loop%,1))
  76.  a% >= 65 
  77.  a% <= 122 
  78.  (a% 
  79.  32) = 32 
  80.  a%> 64 
  81.  a%<123 
  82.  a%=a%-32
  83.  a%>223 
  84.  a%<255 
  85.  a%=a%-32
  86.  a%=34 
  87. ("|")
  88.  ntext$+=
  89. =ntext$
  90.