Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> fillockconnget()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FilLockConnGet()
------------------------------------------------------------------------------
 Purpose:
 Get the workstation that has locked a record.

 Syntax:
 iStation = FilLockConnGet( lpszFileSpec, dwRecordNumber, wFormat )

 Parameters:
 lpszFileSpec   The file name and path.
 dwRecordNumber The record number.
 wFormat        The type of lock system.

 Returns:
 A numeric value (signed short int).

 The CA-Clipper name for this function is:
 FilLokConGet()

 Description:
 FilLockConnGet() returns the station number which has locked record
 dwRecordNumber in the file lpszFileSpec. Returns 0 if no station has
 the record locked or NOVERRINT if an error occurs.

 Because there are many record locking mechanisms NOVLIB has some of the
 most common xBase mechanisms pre-programmed internally. The wFormat
 parameter dictates which record locking mechanism is in use for the file
 lpszFileSpec.

 Supported mechanisms are:

 NOVLOKCLIPPER Billion + recno() mechanism used by CA-Clipper
 NOVLOKNTX2    NTX2 locks used by CA-Clipper
 NOVLOKFOX1    FoxPro structured index locking
 NOVLOKFOX2    FoxPro non-structured index locking
 NOVLOKWILD    Free format locks

 If NOVLOKWILD is specified, the user must calculate the record offset of
 the lock manually. Therefore dwRecordNumber becomes the record offset
 instead of the record number.

 lpszFileSpec must be the full path name of the file.

 Example:
 // To display the station number which has locked record
 // number 10 of the file "SYS:ACCOUNTS/SALES.DBF" using CA-Clipper standard
 // locking:

 iStationNo=FilLockConnGet("SYS:ACCOUNTS\SALES.DBF",10,NOVLOKCLIPPER )
 do case
    case iStationNo > 0
       ? "Station number ", iStationNo " has locked record 10"
    case iStationNo = 0
       ? "Record 10 is not locked"
    otherwise
       ? "Error"
 endcase

 // To display the station number which has locked record number 239
 // using a custom database where the record lengths are 100 bytes with no
 // header:

 iStationNo = FilLockConnGet("SYS:ACCOUNTS\SALES.DAT", 239*100, NOVLOKWILD)
 do case
    case iStationNo > 0
       ? "Station number ", iStationNo " has locked record 239"
    case iStationNo = 0
       ? "Record 239 is not locked"
    otherwise
       ? "Error"
 endcase

 Notes:
 This function requires that the requesting user has console
 operator status.

See Also: UsrNameGet() WSLoginIDGet() WSLoginNameGet()

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