home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / HUGEARR / HUGEINFO.C < prev    next >
C/C++ Source or Header  |  1993-12-01  |  1KB  |  45 lines

  1.  
  2. #define NOCOMM
  3. #include <windows.h>
  4.  
  5. #include "hugearr.h"
  6.  
  7. /* Return the number of huge arrays that have been dimensioned but not erased. */
  8. /* VBM: Declare Function VBHugeNumArrays% Lib "hugearr.dll" Alias "VBHugeNumArrays" () */
  9. int FAR PASCAL
  10. VBHugeNumArrays(VOID)
  11.     {
  12.     PHUGEDESC pArray;  /* pointer to current descriptor */
  13.     int num, i;        /* number free so far */
  14.  
  15.     pArray = (PHUGEDESC) LocalLock(hLocalMem);
  16.  
  17.     for (i = 0, num = 0; i < NumArrays; i++, pArray++)
  18.         if (pArray -> handle == NULL)
  19.             ++num;
  20.  
  21.     LocalUnlock(hLocalMem);
  22.     return num;
  23.     }
  24.  
  25. /* Return the upper bound of a huge array. */
  26. /* The lower bound is always zero, and the number of elements is ubound + 1. */
  27. /* VBM: Declare Function VBHugeUbound& Lib "hugearr.dll" Alias "VBHugeUBound" (ByVal hArray%) */
  28. long FAR PASCAL
  29. VBHugeUbound(int hArray)
  30.     {
  31.     PHUGEDESC pArray;  /* pointer to array descriptor */
  32.     long ubound;       /* upper bound of array */
  33.  
  34.     DecCheckHandle(hArray);
  35.  
  36.     pArray = (PHUGEDESC) LocalLock(hLocalMem) + hArray;
  37.  
  38.     CheckNotAllocYet(pArray);
  39.  
  40.     ubound = pArray -> ubound;
  41.     LocalUnlock(hLocalMem);
  42.  
  43.     return ubound;
  44.     }
  45.