home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 601-625 / apd611 / indexnode.asc < prev    next >
Text File  |  1994-01-11  |  3KB  |  61 lines

  1. '///////////////////////////////////////////////////////////////////////////// 
  2. '// This program adds an Index node to the converted Commodore autodocs,    // 
  3. '// enabling return to the main Lib_Index file in a single step via the     //     
  4. '// Index button on the hypertext viewer program.                           // 
  5. '// This covversion will be done from and to the Ram Disk:, ie this         //   
  6. '// program will overwrite the ram: files so there won't be two sets of     // 
  7. '// files after this conversion.                                            // 
  8. '// You should create a temporary drawer on the Ram Disk: and place as many // 
  9. '// of the converted Commodore Autodoc files in this drawer as you feel     // 
  10. '// comfortable with. ie dont bring your memory right down to zero, I need  // 
  11. '// some memory to work with too!                                           //   
  12. '// The file selector that comes up at the beginning is really a Dir        // 
  13. '// selector but you must pass any filename from this drawer otherwise I    //           
  14. '// will get an empty string for the path which is no good, especially since// 
  15. '// there is no error hanling in this program. So be warned, get it right,  // 
  16. '// give me a full path to any file in the Ram: drawer that you've put the  // 
  17. '// docs into.  After conversion this drawer will contain the converted     //   
  18. '// docs with the Index node inserted into them.                            // 
  19. '// If you don't have enough ram then you can do it from floppy disk just   // 
  20. '// by changing lines 24 and 25 below to your chosen path                   // 
  21. '///////////////////////////////////////////////////////////////////////////// 
  22. '
  23. Global PATH2$
  24. Dir$="Ram Disk:"
  25. PATH$=Fsel$("Ram Disk:",""," Choose any file from ","the correct DRAWER!!")
  26. CHAR=Instr(PATH$,"/",1)
  27. PATH2$=Left$(PATH$,CHAR-1)
  28. FILE$=Dir First$(PATH2$)
  29. CHAR=Instr(FILE$," ",2)
  30. FILE$=Mid$(FILE$,2,CHAR-2)
  31. Proc CONVERT[FILE$]
  32. For I=1 To 50
  33.    FILE$=Dir Next$
  34.    Exit If FILE$=""
  35.    CHAR=Instr(FILE$," ",2)
  36.    FILE$=Mid$(FILE$,2,CHAR-2)
  37.    Proc CONVERT[FILE$]
  38. Next I
  39. Print "All Done"
  40. End 
  41. '
  42. '
  43. Procedure CONVERT[FILE$]
  44.    Set Input 10,-1
  45.    INDEX$="@Index "+Chr$(34)+"Lib_Index/Main"+Chr$(34)+Chr$(10)
  46.    FOOTER$="@endnode Main"+Chr$(10)
  47.    Open In 1,PATH2$+"/"+FILE$
  48.    L=Lof(1)
  49.    Line Input #1,LINE$
  50.    Close 1
  51.    LINE$=LINE$+Chr$(10)
  52.    Reserve As Work 7,L+100
  53.    Reserve As Work 8,L
  54.    Copy Varptr(LINE$),Varptr(LINE$)+Len(LINE$) To Start(7)
  55.    Copy Varptr(INDEX$),Varptr(INDEX$)+Len(INDEX$) To Start(7)+Len(LINE$)
  56.    Bload PATH2$+"/"+FILE$,Start(8)
  57.    Copy Start(8)+Len(LINE$),Start(8)+L To Start(7)+Len(LINE$)+Len(INDEX$)
  58.    Bsave PATH2$+"/"+FILE$,Start(7) To Start(7)+Len(INDEX$)+L
  59.    Erase 7 : Erase 8
  60. End Proc
  61.