Category : BASIC Source Code
Archive   : HUGARY.ZIP
Filename : HUGEINFO.C

 
Output of file : HUGEINFO.C contained in archive : HUGARY.ZIP


#define NOCOMM
#include

#include "hugearr.h"

/* Return the number of huge arrays that have been dimensioned but not erased. */
/* VBM: Declare Function VBHugeNumArrays% Lib "hugearr.dll" Alias "VBHugeNumArrays" () */
int FAR PASCAL
VBHugeNumArrays(VOID)
{
PHUGEDESC pArray; /* pointer to current descriptor */
int num, i; /* number free so far */

pArray = (PHUGEDESC) LocalLock(hLocalMem);

for (i = 0, num = 0; i < NumArrays; i++, pArray++)
if (pArray -> handle == NULL)
++num;

LocalUnlock(hLocalMem);
return num;
}

/* Return the upper bound of a huge array. */
/* The lower bound is always zero, and the number of elements is ubound + 1. */
/* VBM: Declare Function VBHugeUbound& Lib "hugearr.dll" Alias "VBHugeUBound" (ByVal hArray%) */
long FAR PASCAL
VBHugeUbound(int hArray)
{
PHUGEDESC pArray; /* pointer to array descriptor */
long ubound; /* upper bound of array */

DecCheckHandle(hArray);

pArray = (PHUGEDESC) LocalLock(hLocalMem) + hArray;

CheckNotAllocYet(pArray);

ubound = pArray -> ubound;
LocalUnlock(hLocalMem);

return ubound;
}