home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / internet / mailbot_1 / !MBotUser / MailCopy (.txt) < prev   
RISC OS BBC BASIC V Source  |  1995-02-26  |  2KB  |  78 lines

  1.  > MailCopy
  2.  This short program copies the mailboxes in <Mail$Dir>.spool.mail.text
  3.  to Bot:OtherMail, if the destination file exists the new file is
  4.  appended to it.
  5.  thowat@xargle.demon.co.uk
  6.  "Hourglass_Smash":
  7.  buffer% 256
  8.  files$(255), types%(255)
  9. 'pos%=0:amax%=0:ap%=0:hgp%=0:hgmax=0
  10. &from$="<Mail$Dir>.spool.mail.text"
  11. out$="Bot:User.OtherMail."
  12.  Get list of files & types...
  13.  "Hourglass_On"
  14.  "OS_GBPB",12,from$,buffer%,1,pos%,256,0 
  15.  ,,,n%,pos%
  16.  pos%<>-1
  17.  buffer%!20=&FFF 
  18. !     types%(amax%)=buffer%!20
  19. '     files$(amax%)=
  20. str(buffer%+24)
  21.       hgmax%=hgmax%+buffer%!8
  22.      amax%=amax%+1
  23.  buffer%!20<>&FFF 
  24. 8     
  25.  "Warning : Non-text file '";
  26. str(buffer%+24);
  27. /     
  28.  "'"';
  29. (10);"in ";from$;", ignoring."
  30.  "OS_GBPB",12,from$,buffer%,1,pos%,256,0 
  31.  ,,,n%,pos%
  32.  Process boxes...
  33.  ap%<amax%
  34. '#  filein$=from$+"."+files$(ap%)
  35.   fileout$=out$+files$(ap%)
  36. process(filein$,fileout$,types%(ap%))
  37.  "Hourglass_Percentage",
  38. ((100/hgmax%)*hgp%)
  39.   ap%=ap%+1
  40.  "Hourglass_Off"
  41. process(filein$,fileout$,type%)
  42.  inhan%,outhan%,buff$
  43.  type%=&FFF 
  44.   inhan%=
  45. (filein$)
  46.   hgp%=hgp%+
  47. #inhan%
  48.   outhan%=
  49. (fileout$)
  50.  outhan%=0 
  51.  outhan%=
  52. (fileout$)
  53. #outhan%=
  54. #outhan%
  55. #outhan%<>0 
  56. #outhan%,""
  57.   buff$=
  58. #inhan%
  59. #inhan%
  60. #outhan%,buff$
  61.     buff$=
  62. #inhan%
  63.         
  64. #inhan%
  65. #outhan%
  66.  "OS_File",18,fileout$,&FFF
  67.  "OS_File",6,filein$
  68. str(address%)
  69.  ret$,index%,byte%
  70. index%=0
  71. byte%=address%?index%
  72.  byte%<>0
  73.   ret$+=
  74.  byte%
  75.   index%+=1
  76.   byte%=address%?index%
  77. P    =ret$
  78.