cmxAutoOpen[solved]

cmxAutoOpen[solved]

Postby Salvo1087 » Sat Jan 22, 2011 12:15 pm

Hi All ,
i'm looking for a function that perform the same task of cmxAutoOpen. I use fivewin 6.12 for harbour.Some one have any ideal? thanks all

regards
Last edited by Salvo1087 on Mon Apr 11, 2011 4:17 pm, edited 1 time in total.
Salvo1087
 
Posts: 34
Joined: Fri Jan 07, 2011 5:39 pm

Re: cmxAutoOpen

Postby James Bott » Sun Jan 23, 2011 7:02 pm

You can use the CDX RDD, but I am not sure it was available for your older version of FWH. Perhaps it is time to upgrade--there are so many new features.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: cmxAutoOpen

Postby Salvo1087 » Mon Jan 24, 2011 10:59 am

thanks for board. where i can find lib CDX ? i have include yet lib RDD in my build.bat .In any case there is a similar function to cmxAutoOpen?

regards
Salvo
Salvo1087
 
Posts: 34
Joined: Fri Jan 07, 2011 5:39 pm

Re: cmxAutoOpen

Postby James Bott » Mon Jan 24, 2011 7:35 pm

Salvo,

The RDD libs are within one of the FIVE...LIBs--I don't know which one. Below is an example of their use. The index file is opened automatically by default.

Regards,
James


Code: Select all  Expand view  RUN
function main()

   REQUEST DBFCDX
   REQUEST DBFFPT  // if you are using memo fields
   RddSetDefault( "DBFCDX" )
   
   use customer  
   index on chgno tag "custid" to customer for ! deleted()
   index on descrip tag "company" to customer for ! deleted()
   index on phone tag "phone" to customer for ! deleted()

   use
   use customer
   // the index is automatically opened
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: cmxAutoOpen

Postby Salvo1087 » Tue Jan 25, 2011 5:32 pm

james,
thanks for support. for example in this case how i can modified the source code?
Code: Select all  Expand view  RUN
local nArea:=select(),aFiles,lGiaAperto,cNome,nI,cChiave

        *        select pratiche
        *        cChiave:=cod_pratica
        close databases
        aFiles:=directory("*.dbf")
//  cmxAutoOpen(.f.)
   
     
        for nI=1 to len(aFiles)
                cNome:=aFiles[nI][1]
                use (cNome) alias tmpPack exclusive new
                pack
                 
                use
           
        next
     
     
//  cmxAutoOpen(.t.)

thanks for support. regards
Salvo
Salvo1087
 
Posts: 34
Joined: Fri Jan 07, 2011 5:39 pm

Re: cmxAutoOpen

Postby James Bott » Tue Jan 25, 2011 6:24 pm

Salvo,

I don't know if there is a function to turn off auto opening of the index, but you could try turning it off after it is opened using dbClearIndex().

use (cFile)
dbClearIndex()

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: cmxAutoOpen

Postby Enrico Maria Giordano » Tue Jan 25, 2011 6:26 pm

James Bott wrote:I don't know if there is a function to turn off auto opening of the index,


What about

Code: Select all  Expand view  RUN
SET AUTOPEN OFF


?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: cmxAutoOpen

Postby James Bott » Tue Jan 25, 2011 6:32 pm

Enrico,

I tried SET AUTOOPEN OFF but it errors out with a syntax error. I tried including dbinfo.ch and it still errors out. I searched my entire hard disk for AUTOOPEN and only found it in dbinfo.ch.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: cmxAutoOpen

Postby Enrico Maria Giordano » Tue Jan 25, 2011 8:38 pm

It is AUTOPEN not AUTOOPEN.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: cmxAutoOpen

Postby James Bott » Tue Jan 25, 2011 9:54 pm

Enrico,

Ah, I thought AUTOPEN was a typo. That works. Thanks.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: cmxAutoOpen

Postby Salvo1087 » Wed Jan 26, 2011 11:21 am

thanks to both,but if use function set autopen off and on ,i have the same result. this is error,and this is log

Error description: Error DBFNTX/1201 Workarea not indexed


Stack Calls
===========
Called from: => DBSEEK(0)
Called from: main.prg => FINITFASC(898)
Called from: main.prg => FCARPRAT(778)
Called from: main.prg => MAIN(136)


Variables in use
================
Procedure Type Value
==========================
DBSEEK
Param 1: C "ABCD PARTE"
Param 2: U
Param 3: U
Local 1: N 0
FINITFASC
Param 1: L .F.
Param 2: C " "
Param 3: L .F.
Param 4: L .F.
Param 5: A Len: 2
Param 6: A Len: 2
Param 7: C " "
Local 1: N 21
FCARPRAT
Param 1: L .F.
Param 2: L .F.
Param 3: N 1
Param 4: C "ABCD "
Param 5: C " "
Param 6: C " ÓÀEkM;ÌIlŸIUO £c¡1j,;­'ñ 8. £c¡1j,;­'ñ 8. £c¡1j,;­'ñ 8. £c¡1j,;­'ñ 8."
Param 7: D - -
Param 8: D - -
Param 9: C " "
Param 10: C " "
Param 11: C " "
Param 12: C " "
Param 13: N 0.00
Param 14: N 3
Param 15: N 0
Param 16: C " "
Param 17: C " "
Param 18: U
Param 19: U
Param 20: C ""
Param 21: C "abcd A "
Param 22: N 0
Param 23: C " "
Param 24: C " "
Param 25: L .F.
Param 26: L .F.
Param 27: A Len: 2
Param 28: A Len: 2
Param 29: C " "
Param 30: C " "
Param 31: N 0.00
Param 32: L .F.
Param 33: L .F.
Param 34: L .F.
Param 35: C " "
Param 36: C " "
Param 37: U
Param 38: C " "
Param 39: C " "
Param 40: U
Param 41: C ""
Param 42: C " "
Local 1: N 21
Local 2: U
MAIN
Local 1: C ""
Local 2: U
Local 3: O Class: TMENU
Local 4: O Class: TICON
Local 5: U
Local 6: O Class: TPANEL
Local 7: U
Local 8: U
Local 9: C "millennium"
Local 10: N 16
Local 11: N 2
Local 12: N 100
Local 13: N 2
Local 14: N 20
Local 15: N 90
Local 16: N 360
Local 17: N 80
Local 18: N 170
Local 19: N 230
Local 20: N 325
Local 21: N 380
Local 22: N 100
Local 23: N 450
Local 24: N 4
Local 25: N 10
Local 26: N 100
Local 27: N 200
Local 28: N 300
Local 29: U
Local 30: N 40
Local 31: N 140
Local 32: N 240
Local 33: N 340
Local 34: N 410
Local 35: N 480
Local 36: U
Local 37: U
Local 38: N 0
Local 39: N 12632256
Local 40: C "D@vide M i l l e n n i u m"

Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX

DataBases in use
================

1: ANTICIPI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

2: FORMUL RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 1 .F. .F.

Indexes in use TagName

Relations in use

3: ATTI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

4: RIVALUTA RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

5: DOCUMENT RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

6: PROPOSTE RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

7: PARCELLE RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

8: SCADPAG RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

9: NOTA_SPE RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

10: ANAG RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

11: ANAGIST RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use
1: TO cod_Anag INTO ANAG

12: AN_PARTI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

13: => PARTI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use
1: TO cod_Anag INTO AN_PARTI

14: AN_CPARTI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

15: CPARTI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use
1: TO cod_Anag INTO AN_CPARTI

16: AN_ALTRI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

17: ALTRI RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use
1: TO cod_Anag INTO AN_ALTRI

18: AGENDA RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 0 .T. .T.

Indexes in use TagName

Relations in use

19: TMPAUTORIT RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
17 16 .T. .T.

Indexes in use TagName

Relations in use

20: CONTROVE RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
2 1 .T. .T.

Indexes in use TagName

Relations in use

21: PRATICHE RddName: DBFNTX
==============================
RecNo RecCount BOF EOF
1 1 .F. .F.

Indexes in use TagName

Relations in use
1: TO fCodContro(pratiche->cod_pratic) INTO CONTROVE
2: TO PRATICHE->AUTORITA INTO TMPAUTORIT

error main.prg(898)
select parti
set filter to upper(cod_contro+qualita)=upper(cCodFascicolo+STR_PARTI)
seek upper(m->cCodFascicolo+STR_PARTI)

select cparti
set filter to upper(cod_contro+qualita)=upper(cCodFascicolo+STR_CPARTI)
seek upper(m->cCodFascicolo+STR_CPARTI)

error main.prg(136)
fCarPrat(.f.,.f.,pratiche->(recno()),@cCodFascicolo,@cFascicolo,@cDescr,@dDataInizio,;
@dDataFine,@cCodAutorita,@cAutorita,@cSede,@cNumCausa,@nValore,@nTipo,@nDifficolta,;
@cCodStato,@cStato,@dUltUdienza,@dProssUdienza,@mNote,@cCodPratica,@nRif,;
@cNomeGiudice,@cCodice,@lVisColl,@lVisSegr,@aLegali,@aCodLegali,@cLegale,;
@cNumFasc,@nValFatt,@lFatturata,@lModificata,@lSaldata,@cCodProcedura,@cProcedura,;
@oAssociato,@cAssociato,@cCodAssociato,@oDomicil,@cDomicil,@cCodDomicil)
// @ 30, 0 BUTTON oBtnMostraNascondi prompt "Nascondi" OF oPanel ACTION Msginfo("ok") pixel
@ 0, 0 LISTBOX m->oLbxPratiche;

error(779) main.prg
fInitPratiche(lInsert, nPos, @cCodFascicolo, @cFascicolo, @cDescr, @dDataInizio, ;
@dDataFine, @cCodAutorita, @cAutorita, @cSede, @cNumCausa, @nValore, @nTipo, @nDifficolta, ;
@cCodStato, @cStato, @dUltUdienza, @dProssUdienza, @mNote, @cCodPratica, @nRif,@cNomeGiudice,;
@cNumFasc,@nValFatt,@lFatturata,@lSaldata,@lModificata,@cCodProcedura,@cProcedura,;
@oAssociato,@cAssociato,@cCodAssociato,@oDomicil,@cDomicil,@cCodDomicil,.f.)

fInitFasc(lInsert, @cCodice, @lVisColl, @lVisSegr, @aLegali, @aCodLegali, @cLegale)

i have used function set autopen in this way :
set autopen off

for nI=1 to len(aFiles)
cNome:=aFiles[nI][1]
use (cNome) alias tmpPack exclusive new
pack

use

next

set autopen on

is possible(in error 898) that the varible cCodFascicolo,since it exceededs the 10-character, give errors? thanks.
regards
Salvo
Salvo1087
 
Posts: 34
Joined: Fri Jan 07, 2011 5:39 pm

Re: cmxAutoOpen

Postby James Bott » Wed Jan 26, 2011 4:07 pm

It appears that you have not opened the indexes. Also, the error message shows that you are using NTXs not CDXs. Again I am not sure that your old version of FWH supports CDXs.

When having problems like this I try to write the smallest possible code to test the problem. It seems you are trying to convert an entire program instead. Try writing the smallest possible test program.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: cmxAutoOpen

Postby StefanHaupt » Thu Jan 27, 2011 8:41 am

James,

the support of cdx doesn´t depend on the version fwh, but on xharbour/harbour. Both supports cdx since it´s earliest versions. The rdd libs are part of xharbour/harbour.

Salvo,

1: you don´t use cdx, as James already said. You have to write these lines at the beginning of your code
Code: Select all  Expand view  RUN
REQUEST DBFCDX
REQUEST DBFFPT  // for memo fields
RddSetDefault( "DBFCDX" )

to set the standard dbf driver to cdx. You have to add the libs dbfcdx and dbfftp in your link script if not already done.

2: Your error comes from the function dbseek(). dbseek() needs an index, otherwise an error occurs. With SET AUTOPEN OFF you are closing all indexes. You have to open them again before you can use dbseek() ( or the command SEEK).
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: cmxAutoOpen

Postby Salvo1087 » Thu Jan 27, 2011 10:48 am

James , Stefanhaupt

thanks a lot ,the error was the wrong indexes NTX. with the command request and function rddsetdefault , error was fixed !!


Stefanhaupt,

i have used also set autopen on after set autopen off. it is wrong? must be used before seek?
Salvo1087
 
Posts: 34
Joined: Fri Jan 07, 2011 5:39 pm

Re: cmxAutoOpen

Postby James Bott » Thu Jan 27, 2011 12:35 pm

i have used also set autopen on after set autopen off. it is wrong? must be used before seek?


Yes, you must turn it back on after the PACK. You must also open the file and rebuild the indexes after the PACK. After that each time you open the DBF the index file will also be opened.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 12 guests