• XbQueryLogEntryNum(nEvtHandle, @nRecords)


    • Description
      this function retrieves the number of records in the specified event log.
    • Parameter(s)

      hEventLog
      Identifies the event log to be closed.
      This handle is returned by the XbOpenEventLog function

      nRecords (by reference)
      points to a numeric-variable that receives the number of records in the given event log.

    • Return Value
      If the function succeeds, the return value is TRUE, otherwise FALSE.
      To get extended error information, call XbEventGetLastError.
  • Sample
    #include "xbevent.ch"

    local nEvtHandle    := 0
    local cError        := space(100)
    local nRecords      := 0

    //
    // open a Eventlog-Key and directly close key again
    //
    if ((nEvtHandle := XbOpenEventLog(, "WinApp")) <= 0)
      XbEventGetLastError(@cError)
      ? "Error :", cError
    else
      if (XbQueryLogEntryNum(nEvtHandle, @nRecords)== FALSE)
        XbEventGetLastError(@cError)
        ? "Error :", cError
      else
        ? "we have", nRecords, "entries in this logfile"
      endif
      XbCloseEventLog(nEvtHandle)
    endif