home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / filemanager / director_1 / !Director / Utils / RunFilerAc (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1995-08-04  |  2KB  |  66 lines

  1.  >RunFilerAc
  2.  (C) Nick Craig-Wood 1994
  3.  This is for starting off Filer_Action tasks
  4.  It expects <Dir> <Leaf> and <Path> to be set up
  5. buffer_size%=1024
  6.  buffer% buffer_size%
  7. $+" at "+
  8.  "OS_GetEnv" 
  9.  env%
  10.  "OS_ReadArgs",",quit=load,/E,/G,value/E",env%,buffer%,buffer_size%
  11. type%=
  12. eval(buffer%!8)
  13. gstrans(buffer%!12)
  14. value%=
  15. eval(buffer%!16)
  16.  type%=-1 
  17.  1,"Syntax: *RunFilerAc <type> [<to>] [-value <bits>]"
  18.  "Wimp_Initialise",200,&4B534154,"RunFilerAction" 
  19.  ,taskID%
  20. closedown: 
  21. $+" at "+
  22.  "Wimp_StartTask","Filer_Action" 
  23.  handle%
  24.  "FilerAction_SendSelectedDirectory",handle%,
  25. var("Dir")+
  26.  "FilerAction_SendSelectedFile",handle%,
  27. var("Leaf")+
  28.  "OS_Byte",&A1,&C6 
  29.  ,,bits%
  30. ebits% = ((bits% 
  31.  &40) >> 6) 
  32.  ((bits% 
  33.  &20) >> 4) 
  34.  ((bits% 
  35.  &10) >> 2) 
  36.  ((bits% 
  37.  &80) >> 4)
  38. !buffer%=value%
  39. value%=buffer%
  40.  to$="" 
  41.  "FilerAction_SendStartOperation",handle%,type%,bits%,value%,4
  42.  "FilerAction_SendStartOperation",handle%,type%,bits%,to$+
  43. (to$)+1
  44. closedown
  45. closedown
  46.  "Wimp_CloseDown"
  47. var(var$)
  48.  a$,i$,len%
  49.  "OS_ReadVarVal",var$,buffer%,buffer_size%,0,3 
  50.  ,,len%
  51.   buffer%?len%=&D
  52. =$buffer%
  53. gstrans(p%)
  54.  i%,a$
  55.  p%=0 
  56.   len%=(!p%) 
  57.  &FFFF
  58.   a$=""
  59.  i%=2 
  60.  2+len%-1
  61.     a$+=
  62. (p%?i%)
  63. eval(p%)
  64.  p%=0 
  65. C    =p%!1
  66.