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_checku( [ <cfilespec> [, <nstanum> ] ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_CHECKU( [ <cFilespec> [, <nStanum> ] ] )

Parameters

<cFilespec>
Path (optional) and filename of the file in question. The default is 
the current file.

<nStanum>
Optional station number to query. If omitted, all currently logged-in 
stations, except for the current station, are queried.


Returns

A list of stations, if any, that have the specified file in use. The 
list is returned as a character string, each byte of which contains the 
ASCII code of a station-that is, CHR(1-255).

The list does not indicate whether the file is opened for exclusive or 
non-exclusive use. The current station is never included in the list, 
even if it is using the file.

A null string indicates that no other station has the file opened.

Description

The default for <cFilespec> is the current file. Thus if the function 
is called with no argument, it will return a list of stations, if any, 
that are using the current file.

A path may be specified in <cFilespec> but will be ignored. Thus, if a 
station uses the same file name in two different directories, it will 
not be possible for another station to distinguish between them.

If <nStanum> is specified, only that station is queried. Use it when 
you need to determine if a specific station has a file in use.


Example

// Use file exclusively or display
// who the offenders are.
USE custfile EXCLUSIVE

IF NETERR()
  station_list = N_CHECKU('Custfile.dbf')

  @ 1, 0 SAY 'Can't use file because of stations: '

  FOR k = 1 TO LEN(station_list)
    @ 1, COL() + 1 SAY ASC(SUBSTR(station_list, k, 1))
  NEXT
ENDIF



See Also: N_CHECKF() N_CHECKR() N_MONITOR()

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