FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Hash - Averiguar Etiqueta
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Hash - Averiguar Etiqueta
Posted: Thu Nov 26, 2020 03:26 PM
Hola Gente
Supongamos que tengo definido un Hash de la siguiente manera
Code (fw): Select all Collapse
[DEFAULT]
codpos= 3500
localidad=Resistencia

[FR]
DesignFR=NO
PreviewFR=NO
DlgPrnFR=NO

Inicialmente, cuando no existe la etiqueta; consulto asi:
Code (fw): Select all Collapse
if  "CODPOS" IN ::hIni 
...
end

Pero, el compilador me devuelve el error:
--------------------Configuración: mgGeCont - Debug--------------------
Harbour 3.2.0dev (r1801051438)
Copyright (c) 1999-2016, http://harbour-project.org/
D:\Fuen32\GesCont\Source\GC_Menu.prg(190) Error E0030 Syntax error "syntax error at 'IN'"
D:\Fuen32\GesCont\Source\GC_Menu.prg(213) Error E0010 ENDIF does not match IF
D:\Fuen32\GesCont\Source\GC_Menu.prg(236) Error E0030 Syntax error "syntax error at 'STATIC'"
3 errors

Leyendo la Ayuda de Harbour encuentro:
Code (fw): Select all Collapse
hb_HHasKey(<hHash>, <xKey> [, @<nPos> ])

Pero al compilar me dice que la función no existe

Que puedo/debo usar para esta consulta ?
Gracias!
Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 1816
Joined: Wed Oct 26, 2005 02:49 PM
Re: Hash - Averiguar Etiqueta
Posted: Thu Nov 26, 2020 11:05 PM
No si te falta el endif, así me funciona bien
Code (fw): Select all Collapse
        if ndDet IN hDoc
            if valtype(hDoc[ndDet]) # "A"
                AADD(aError,"El Contenido Del Nodo Detalle Debe Ser De Tipo ARRAY")
            else
                oObjFac:detalle := hDoc[ndDet]
            endif
        else
            AADD(aError,"No Existe El Nodo Detalle")
        endif


Code (fw): Select all Collapse
//Otra forma 
cMatricula:=HGetKeyAt(aHash,nIndice)


http://forums.fivetechsupport.com/viewtopic.php?f=6&t=23671&hilit=iniciandome+hash
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: Hash - Averiguar Etiqueta [SOLUCIONADO]
Posted: Thu Nov 26, 2020 11:49 PM
Gracias por responder Leandro
Incluyendo la cláusula que contiene IN, me sigue dando error (verfique el if - endif)
Pero lo que puedo haber escrito mal es:
Code (fw): Select all Collapse
hb_HHasKey(<hHash>, <xKey>)

Ya que volví a probar y; no me da error.
De manera que de esta forma quedo solucionado

seguimos...
Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina

Continue the discussion