#include "fivewin.ch"
REQUEST DBFCDX
REQUEST DBFFPT
static nStartTime, nDuration
FUNCTION CONTA_TELEFONATE()
LOCAL cAmIni := SUBSTR( DTOS( DATE() ) , 1 , 6 )
LOCAL cAmFin := SUBSTR( DTOS( DATE() ) , 1 , 6 )
LOCAL aLista := {}
LOCAL cChiamante := SPACE( 30 )
LOCAL cChiamato := SPACE( 30 )
LOCAL cDbf
LOCAL oExcel , oAs
local nMatches := 0
/*
local aFields := { { "EVENT", "C", 20, 0 },;
{ "TIME", "N", 14, 0 },;
{ "DATE", "C", 20, 0 },;
{ "REF", "C", 50, 0 },;
{ "DIR", "C", 5, 0 },;
{ "SRC_IF", "C", 20, 0 },;
{ "DST_IF", "C", 20, 0 },;
{ "SRC_CGPN", "C", 20, 0 },;
{ "SRC_CDPN", "C", 20, 0 },;
{ "SRC_NAME", "C", 30, 0 },;
{ "DST_CGPN", "C", 20, 0 },;
{ "DST_CDPN", "C", 20, 0 },;
{ "SRC_REG_NA", "C", 20, 0 },;
{ "BCAPS", "C", 20, 0 },;
{ "CAUSE", "C", 20, 0 },;
{ "XCODER", "C", 20, 0 },;
{ "RCODER", "C", 20, 0 },;
{ "XSTATS", "C", 20, 0 },;
{ "RSTATS", "C", 20, 0 },;
{ "ALERT_TIME", "N", 14, 0 },;
{ "CONNECT_TI", "N", 14, 0 },;
{ "DISC_TIME", "N", 14, 0 },;
{ "SRV_ID", "C", 20, 0 },;
{ "SECONDI", "N", 10, 0 },;
{ "DURATA", "C", 30, 0 },;
{ "TCOSTOUNI", "N", 10, 0 },;
{ "TCOSTOSEC", "N", 10, 0 },;
{ "TSEC", "N", 10, 0 },;
{ "DO", "C", 20, 0 },;
{ "TARIFFA", "C", 3, 0 },;
{ "COSTO", "N", 14, 5 },;
{ "COSTO2", "N", 14, 5 },;
{ "UTEMODI", "C", 3, 0 },;
{ "DATMODI", "C", 14, 0 } }
DbCreate( "myfile.dbf", aFields, "DBFCDX" )
*/
cChiamante := "351573******" //ALLTRIM( cChiamante )
cChiamato := ALLTRIM( cChiamato )
nInizio := SECONDS()
// use ( "s:\datamarco\myfile.dbf" ) new
// index on field->src_cgpn tag myidx
// USE
? "weiter"
nStartTime := SECONDS()
use ( "s:\datamarco\myfile.dbf" ) new alias I_OTTO // Öffne die DBF-Datei
// set index to "s:\datamarco\myfile.CDX" // Lade die bestehende Indexdatei
set order to tag myidx // Setze den Index-Tag
dbSeek( cChiamante )
DO WHILE FIELD->src_cgpn = cChiamante .and. .not. EOF()
IF !EMPTY( cChiamante )
nMatches ++
IF AT( cChiamante , FIELD->src_cgpn ) > 0
IF field->dir = "out" .AND. field->secondi > 0 .AND. field->event = "B:Rel"
AADD( aLista , { "IN" , field->src_cgpn , SPACE(20) , field->do , field->secondi, field->dst_cdpn } )
ENDIF
ENDIF
ENDIF
IF !EMPTY( cChiamato )
IF AT( cChiamato , FIELD->src_cdpn ) > 0
IF field->dir = "out" .AND. field->secondi > 0 .AND. field->event = "B:Rel"
AADD( aLista , { "OUT" , SPACE( 20 ) , field->src_cdpn , field->do , field->secondi , field->src_cgpn } )
ENDIF
ENDIF
ENDIF
SKIP
ENDDO
USE
nDuration := (SECONDS() - nStartTime)
xbrowse(aLista, "nDuration: "+str(nDuration) + "nMatches: " + str(nMatches))
RETURN NIL
INIT PROCEDURE PrgInit
SET CENTURY ON
SET EPOCH TO YEAR(DATE())-98
SET DELETED ON
SET EXCLUSIVE OFF
REQUEST HB_Lang_DE
HB_LangSelect("DE")
SET DATE TO GERMAN
rddsetdefault( "DBFCDX" )
EXTERN DESCEND
RETURN
Who created the I_otto.dbf file—was it you with your software, or the phone system?
#include "Dbinfo.ch"
REQUEST DBFCDX
REQUEST DBFFPT
FUNCTION MAIN()
LOCAL nSec
RDDSETDEFAULT( "DBFCDX" )
SET DBFLOCKSCHEME TO DB_DBFLOCK_CL53EXT
USE \\yourserver\yourfolder\yourdbf SHARED
SET INDEX TO \\yourserver\yourfolder\yourcdx
nSec = SECONDS()
WHILE !EOF()
SKIP
ENDDO
? SECONDS() - nSec
INKEY( 0 )
RETURN NIL
when DBF is used in Share Mode only Once, it will use SMB "Exlusive Locking" Mode
as soon when DBF was opened second Time it will switch into "Opportunistic Locking"
#include "fivewin.ch"
#include "Dbinfo.ch"
REQUEST DBFCDX
REQUEST DBFFPT
FUNCTION MAIN()
LOCAL nSec
RDDSETDEFAULT( "DBFCDX" )
// SET DBFLOCKSCHEME TO DB_DBFLOCK_CL53EXT
USE ( "s:\datamarco\myfile.dbf" ) SHARED
// SET INDEX TO "s:\datamarco\myfile.CDX"
// set order to tag myidx
nSec = SECONDS()
WHILE !EOF()
SKIP
ENDDO
? SECONDS() - nSec
? "Ende"
INKEY( 0 )
RETURN NIL
Otto wrote:Marco, this sample for me only works if I do not use index.
Otto wrote:Enrico, since there is no display, you can’t see anything. It might work, but I just stopped it after a certain amount of time because it cannot be a solution.
TimStone wrote:Unfortunately, we have no alternatives available. It is very sad.
Tim
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Silvio.Falconi and 49 guests