Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_handles( [ <nhandles> | -1 ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_HANDLES( [ <nHandles> | -1 ] )


Parameters

<nHandles>
The number of file handles to make available to the current station. -1 
Specifies that the function should return the number of file handles in 
use at the current station.


Returns

N_HANDLES() returns the handle count.
N_HANDLES(-1) returns the number of handles in use.


Description

N_HANDLES(<nHandles>) sets the number of file handles. 

Note  If used, N_HANDLES(<nHandles>) must be issued prior to 
N_READY(). Most other NetLib functions are issued after N_READY(). 
N_HANDLES() and N_HANDLES(-1) may be used at any time.

To save memory, always set the number of handles to the lowest 
practical limit for your application. That is, do not use N_HANDLES(71) 
when your application needs 31 files.

Remember that DOS reserves five handles. Thus, N_HANDLES(31) really 
allows 26 files.

The FILES= clause in CONFIG.SYS must be equal to or greater than the 
number of handles specified with N_HANDLES(<nHandles>).

Most networks place a limit on sum total of open handles for all 
stations, regardless of an individual station's settings. Consult your 
network vendor's operations manual for more information and possible 
configuration alternatives.

N_HANDLES(<nHandles>) will work with DOS 3.1 or later. It is especially 
useful for DOS 3.1 and 3.2 which do not support the SET CLIPPER=Fnnn 
environment setting.


Examples

// Allow program to open up to 40 files.
N_HANDLES(40)
N_READY()

// Compute remaining available handles.
avail = N_HANDLES() - N_HANDLES(-1)

// Locate the handle for a specific filename
FUNCTION GetHandle( cFilename )
  LOCAL k

  FOR k = 5 TO N_HANDLES(-1)  // Can't be handle 0-4
     IF UPPER(N_FMAP(k)) == UPPER(cFilename)
       RETURN k               // Handle #
     ENDIF
  NEXT
RETURN 0                      // Not found




See Also: N_FMAP() N_READY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson