home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 601-625 / apd617 / len_tucker / banktostring.amos / banktostring.amosSourceCode
AMOS Source Code  |  1986-08-03  |  1KB  |  47 lines

  1. Screen Open 0,640,256,4,Hires : Curs Off : Flash Off : Cls 0 : Paper 0
  2. ' these variables must be global in your main program
  3. Global DELIMITER,POSINBANK
  4. DELIMITER=10
  5. POSINBANK=0
  6. GTFILE
  7. Repeat 
  8. BANKTOSTRING_EASY[10]
  9. Until POSINBANK+1>=Length(10)
  10. Procedure BANKTOSTRING_CLASSIC[BANK]
  11. H=Hunt(Start(BANK)+POSINBANK To Start(BANK)+Length(BANK),Chr$(DELIMITER))
  12. If H>0 and H<=Start(BANK)+Length(BANK)
  13. SS=H-(POSINBANK+Start(BANK))
  14. N$=Space$(SS)
  15. If SS>0
  16. Copy Start(BANK)+POSINBANK,Start(BANK)+POSINBANK+SS To Varptr(N$)
  17. End If 
  18. Add POSINBANK,SS+1
  19. Print N$
  20. End If 
  21. End Proc[N$]
  22. Procedure BANKTOSTRING_EASY[BANK]
  23. For H=Start(BANK)+POSINBANK To Start(BANK)+Length(BANK)
  24. If Peek(H)=DELIMITER
  25. Exit 
  26. End If 
  27. Next H
  28. If H>0 and H<=Start(BANK)+Length(BANK)
  29. SS=H-(POSINBANK+Start(BANK))
  30. If SS>0
  31. N$=""
  32. For Z=Start(BANK)+POSINBANK To Start(BANK)+POSINBANK+SS-1
  33. N$=N$+Chr$(Peek(Z))
  34. Next Z
  35. End If 
  36. POSINBANK=POSINBANK+SS+1
  37. Print N$
  38. End If 
  39. End Proc[N$]
  40. Procedure GTFILE
  41. Erase 10
  42. Open In 1,"text.asc"
  43. L=Lof(1)
  44. Close 1
  45. Reserve As Work 10,L
  46. Bload "text.asc",10
  47. End Proc