Page 1 of 2
add "temporary" TAG in Index ?
Posted: Tue Nov 01, 2022 12:41 am
by AUGE_OHR
hi,
i want to create a temporary Index TAG and "add" it to existing CDX
i "think" i have to use ADDITIVE when create new Index TAG, but how to "remove TAG"

Re: add "temporary" TAG in Index ?
Posted: Tue Nov 01, 2022 12:53 am
by AUGE_OHR
hi
new Idea
but it fail when compile
harbour have ORDLISTADD() and ORDLISTCLEAR() but no ORDLIST()
under Xbase++ i have ORDLIST() so i can ask
how under harbour / HMG to find out how man Index are SET to working DBF

Re: add "temporary" TAG in Index ?
Posted: Tue Nov 01, 2022 3:06 am
by andyglezl
Maybe this...
Description
DBINFO() retrieves information about a database file. By default, this
function operates on the currently selected work area. It can be made
to operate on an unselected work area by specifying it within an aliased
expression.
Examples
. The following examples return work area information:
#include Dbinfo.ch
? DBINFO(DBI_GETHEADERSIZE) // Same as HEADER()
? DBINFO(DBI_LASTUPDATE) // Same as LUPDATE()
? DBINFO(DBI_GETRECSIZE) // Same as RECSIZE()
? DBINFO(DBI_FILEHANDLE) // DOS file handle for
// the current database
// file
Files Library is CLIPPER.LIB, header file is Dbinfo.ch.
MY SAMPLE...
Code: Select all
FUNCTION CKAliasBD()
LOCAL cAliasAct:=Alias(), i1, i2, cPso:=""
FOR i1=1 TO 150 // Bases de Datos abiertas
cAlias:=ALIAS( i1 )
IF LEN( cAlias ) > 0
SELE (cAlias)
FOR i2:= 1 TO FCOUNT() ; cPso+=DBFIELDINFO(DBS_TYPE, i2) ; NEXT
F_Debug.G_Dbs.AddItem( { DBINFO(DBI_FULLPATH)+IF( "M" $ cPso, " +DBT", "" ), ;
DBINFO(DBI_ALIAS),DBINFO(DBI_DBFILTER), ;
&cAlias.->(ordSetFocus()), ;
TRANSFORM( ( (RECSIZE()*LASTREC()) + HEADER() + 1), "99,999,999"), ;
StrValue(DBINFO(DBI_GETLOCKARRAY)), StrValue(DBINFO(DBI_ISFLOCK)) ;
} )
cPso:=""
ENDIF
NEXT
SELE (cAliasAct)
RETURN( Nil )
Re: add "temporary" TAG in Index ?
Posted: Tue Nov 01, 2022 9:46 am
by SALINETAS24
AUGE_OHR wrote: ↑Tue Nov 01, 2022 12:41 am
hi,
i want to create a temporary Index TAG and "add" it to existing CDX
i "think" i have to use ADDITIVE when create new Index TAG, but how to "remove TAG"
Hola AUGE_OHR, yo trabajo así.
Code: Select all
SELECT fichero
// Genero nombre aleatorio
cFileInd:="I"+cStrZero(INT(HB_RANDOM(1,99999)),5)
// Elijo campo para nuevo indice
cb:=FieldName(3)
// Creo indice por el 3er campo
INDEX ON &cB TO (cFileInd) ADDITIVE
Ya puedo trabajar usando DBSETORDER.
Para eliminarlo
Code: Select all
(cAlias)->(ORDDESTROY(cFileInd))
FERASE(cFileInd)
Vamos con una cervecita fresquita!!
Re: add "temporary" TAG in Index ?
Posted: Tue Nov 01, 2022 3:46 pm
by franco
Maybe,
Code: Select all
INDEX ON recno() TO (cFileInd) ADDITIVE
Re: add "temporary" TAG in Index ?
Posted: Wed Nov 02, 2022 9:10 am
by edk
AUGE_OHR wrote: ↑Tue Nov 01, 2022 12:53 am
hi
new Idea
but it fail when compile
harbour have ORDLISTADD() and ORDLISTCLEAR() but no ORDLIST()
under Xbase++ i have ORDLIST() so i can ask
how under harbour / HMG to find out how man Index are SET to working DBF
Code: Select all
For n := 1 To OrdCount()
msgdebug ( n, OrdName( n ), OrdKey( n ), OrdBagName ( n ) )
Next
Re: add "temporary" TAG in Index ?
Posted: Sat Nov 05, 2022 2:30 am
by AUGE_OHR
hi,
thx all for Answer.
i have test temporary Index and "other" Concept when "search" in Forum Message.
FILTER or Index is like Online where you "just" get "Result"
but often you need hole Thread which include the Message to understand "hole Story"
---
i do have, on right side, Window for "Thread-Error" when download and also use for Attachment
now i use same Style for "FILTER" and present "Result" on right side

- SETFILTER.PNG (255.36 KiB) Viewed 13601 times
when navigate on right side it will "sync" Main so i can read Message.
i use Index TAG "DUOECHECK" which does sort Thread-No so i can "see" hole Thread
here last Version of Modul SETFILTER.PRG
you need to delete all SET FILTER in ChangeFilter() except for Radio-Button
Re: add "temporary" TAG in Index ?
Posted: Tue Jan 24, 2023 9:08 pm
by tonton2
Bonjour voila le nouveau OuvrirFbf
/* I want to create of the Caisse_Extend file.ntx for all items in the Caisse_Extend->Field_Name
// This form
Use Caisse
copy structure extended to Caisse_Extend
use CAISSE_EXTEND
DO WHILE NOT EOF()
for n=1 to HMG_len(CAISSE_EXTEND)
index on Caisse_Extend->Field_Name to xItem+str(n)
....
xitem =: ????str(n) // Xitem+","+xitem
next
skip
ENDDO
set index to ( Xitemstr+(n)+","Xitemstr+(n) for n=1 to HMG_len(CAISSE_EXTEND)
Re: add "temporary" TAG in Index ?
Posted: Wed Jan 25, 2023 8:03 pm
by SALINETAS24
tonton2 wrote: ↑Tue Jan 24, 2023 9:08 pm
Bonjour voila le nouveau OuvrirFbf
/* I want to create of the Caisse_Extend file.ntx for all items in the Caisse_Extend->Field_Name
.../...
Hola, no entiendo bien lo que quieres hacer. Creo entender que quieres crear un indice para cada campo de la DBF. Este código que te paso no lo he probado, igual tienes que ajustarlo pero en principio debera crearte un Indice para cada uno de los campos de la DBF.
Code: Select all
PROC CreaIndices
LOCAL aExtructura, nFor, cCampo, cIndice, Cais, cBase, cIndice
Cais:=(cDossier+"\"+cFichier)
cBase:=cDossier+"\Ind"
USE &cais
aExtructura:=DBSTRUCT()
FOR nFor=1 TO LEN(aExtructura)
cCampo :=FIELNAME(nFor)
cIndice:=cBAse+StrZero(nFor,2)
INDEX ON &cCampo TO (cIndice) ADDITIVE
NEXT
RETURN
Re: add "temporary" TAG in Index ?
Posted: Thu Jan 26, 2023 9:11 am
by tonton2
SALINETAS24 wrote: ↑Wed Jan 25, 2023 8:03 pm
tonton2 wrote: ↑Tue Jan 24, 2023 9:08 pm
Bonjour voila le nouveau OuvrirFbf
/* I want to create of the Caisse_Extend file.ntx for all items in the Caisse_Extend->Field_Name
.../...
Hola, no entiendo bien lo que quieres hacer. Creo entender que quieres crear un indice para cada campo de la DBF. Este código que te paso no lo he probado, igual tienes que ajustarlo pero en principio debera crearte un Indice para cada uno de los campos de la DBF.
Code: Select all
PROC CreaIndices
LOCAL aExtructura, nFor, cCampo, cIndice, Cais, cBase, cIndice
Cais:=(cDossier+"\"+cFichier)
cBase:=cDossier+"\Ind"
USE &cais
aExtructura:=DBSTRUCT()
FOR nFor=1 TO LEN(aExtructura)
cCampo :=FIELNAME(nFor)
cIndice:=cBAse+StrZero(nFor,2)
INDEX ON &cCampo TO (cIndice) ADDITIVE
NEXT
RETURN
Bonjour,
OUI, c'est ça que je veux ,Creer pour chaque champ un fichier ntx .
merci pour votre code je vais l'essayer
Buenos dias,
SÍ, eso es lo que quiero, crear un archivo ntx para cada campo.
gracias por tu codigo lo intentare