home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY1 / EXAMP2.ZIP / PB072590 < prev    next >
Text File  |  1990-07-25  |  2KB  |  64 lines

  1. Date:  22-Jul-90 23:31 PDT
  2. From:  Ray Yates [70144,3213]
  3. Subj:  File handles
  4.  
  5. Tim,
  6.  
  7. I spoke with you about getting the update to Power Basic last week.
  8. I got it saturday. The bug fixes were just what I needed. I also
  9. love the PBPLUS96 program that I downloaded. My hats off to Bob Zale
  10. and Spectra. I'm now able to compile my network database in memory
  11. again with the network loaded. This makes debugging this 7000+ line
  12. program much easier. I've modified a BTree routine by Bob Vest to
  13. work with Power Basic and as soon as I get one more problem solved
  14. I will upload it to Spectra in appreciation for all your fine work
  15. and for all the help I've received from public domain software.
  16.  
  17. If you could please help me one more time I would greatly appreciate
  18. it. I need to know where Power Basic's linked list of file handles is
  19. stored.
  20.  
  21. The following is from the program FILEHAND.BAS by Tod Golding,
  22. Borland Technical Support, downloaded from Compuserve.
  23.  
  24.    Turbo Basic's linked list of file handles is stored in
  25.    the string data segment area.  Two bytes at offsets 6 & 7
  26.    are a pointer to the first node of the linked list.  Each
  27.    node in the linked list has the following format:
  28.  
  29.       | Pointer to next node       |    2 Bytes
  30.       | Pointer to previous node   |    "   "
  31.       | File Number                |    "   "
  32.       | DOS File Handle            |    "   "
  33.  
  34. DEF FNFileHandleAddress%(FileNumber%)
  35. LOCAL Segment%,Ofs%,Done%
  36.   DEF SEG
  37.   Segment% = PEEK(0) + (256 * PEEK(1))   ' Get the string segment.
  38.   DEF SEG  = Segment%
  39.   Ofs%     = PEEK(6) + (256 * PEEK(7))   ' Peek at the first file number.
  40.   Done%    = 1
  41.   WHILE Done% = 1
  42.     IF (PEEK(Ofs%+4) + (256 * PEEK(Ofs%+5))) = FileNumber% THEN
  43.       FNFileHandleAddress% = Peek(Ofs%+6) + (256 * PEEK(Ofs%+7))
  44.       Done% = 0
  45.     ELSEIF (PEEK(Ofs%) + + (256 * PEEK(Ofs%+1))) = 0 THEN
  46.       FNFileHandleAddress% = 0                ' File number not found.
  47.       Done% = 0
  48.     ELSE
  49.       Ofs% = PEEK(Ofs%) + (256 * PEEK(Ofs%+1))   ' Traverse the linked list.
  50.     END IF
  51.   WEND
  52. END DEF
  53.  
  54. I am having trouble with this and appreciate any guidance you could offer.
  55.  
  56. Thanks
  57. Ray Yates  CIS: #70144,3213
  58. Micro Transition Associates
  59.  
  60. 113 Quietwood Ct.
  61. Louisville, Ky 40229
  62. Home Phone: 502 969-1326
  63. Daytime Phone: 502 456-5527
  64.