add "temporary" TAG in Index ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

add "temporary" TAG in Index ?

Post 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" :?:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: add "temporary" TAG in Index ?

Post by AUGE_OHR »

hi

new Idea

Code: Select all

ORDLIST()
but it fail when compile :o

harbour have ORDLISTADD() and ORDLISTCLEAR() but no ORDLIST() :(

under Xbase++ i have ORDLIST() so i can ask

Code: Select all

   ? LEN(ORDLIST())
how under harbour / HMG to find out how man Index are SET to working DBF :?:
have fun
Jimmy
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: add "temporary" TAG in Index ?

Post 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 )
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: add "temporary" TAG in Index ?

Post 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!!
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
franco
Posts: 921
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: add "temporary" TAG in Index ?

Post by franco »

Maybe,

Code: Select all

INDEX ON recno() TO (cFileInd) ADDITIVE
All The Best,
Franco
Canada
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: add "temporary" TAG in Index ?

Post by edk »

AUGE_OHR wrote: Tue Nov 01, 2022 12:53 am hi

new Idea

Code: Select all

ORDLIST()
but it fail when compile :o

harbour have ORDLISTADD() and ORDLISTCLEAR() but no ORDLIST() :(

under Xbase++ i have ORDLIST() so i can ask

Code: Select all

   ? LEN(ORDLIST())
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
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: add "temporary" TAG in Index ?

Post 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
SETFILTER.PNG (255.36 KiB) Viewed 13608 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
SETFILTER_056.ZIP
(2.83 KiB) Downloaded 226 times
have fun
Jimmy
User avatar
tonton2
Posts: 484
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: add "temporary" TAG in Index ?

Post 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)
Attachments
OUVRIR_DBF.rar
(1.77 KiB) Downloaded 194 times
L'Algerie vous salut
Y.TABET
WatsApp :+213770943143
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: add "temporary" TAG in Index ?

Post 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

Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
tonton2
Posts: 484
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: add "temporary" TAG in Index ?

Post 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
L'Algerie vous salut
Y.TABET
WatsApp :+213770943143
Post Reply