ascan y tuplas

ascan y tuplas

Postby goosfancito » Thu Jun 24, 2021 12:40 pm

Hola.

TEngo un array
::aTree (A2)<Array>
::aTree[ 1] (A5)<Array>
::aTree[ 1][ 1] (N) => 0
::aTree[ 1][ 2] (C10) => "01/01/1993"
::aTree[ 1][ 3] (C1) => "a"
::aTree[ 1][ 4] (N) => 1
::aTree[ 1][ 5] (N) => 11024072
::aTree[ 2] (A5)<Array>
::aTree[ 2][ 1] (N) => 0
::aTree[ 2][ 2] (C10) => "01/01/1991"
::aTree[ 2][ 3] (C1) => "b"
::aTree[ 2][ 4] (N) => 1
::aTree[ 2][ 5] (N) => 11024216


Al hacer este codigo, me devuelve siempre cero
Code: Select all  Expand view
oItem:cargo["hitem"]:= 11024216
x := AScan( ::aTree, { | a | a[ 5 ] = oItem:cargo[ "hitem" ] } )


que estoy haciendo mal?
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: ascan y tuplas

Postby karinha » Thu Jun 24, 2021 12:49 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7312
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: ascan y tuplas

Postby goosfancito » Thu Jun 24, 2021 1:22 pm

karina lo que hice es lo que da error. esos ejemplos que me mostras ya lo vi.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: ascan y tuplas

Postby Antonio Linares » Thu Jun 24, 2021 2:38 pm

Prueba asi:

x := AScan( ::aTree, { | a | a[ 5 ] == oItem:cargo[ "hitem" ] } )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41362
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ascan y tuplas

Postby goosfancito » Thu Jun 24, 2021 3:36 pm

ya lo he probado y tampoco.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: ascan y tuplas

Postby Antonio Linares » Thu Jun 24, 2021 4:57 pm

Prueba a usar:

SET EXACT ON
y SET DECIMALS TO ... también

Y para salir de dudas:

x := AScan( ::aTree, { | a | MsgInfo( a[ 5 ], oItem:cargo[ "hitem" ] ), .F. } )

asegurate visualmente que tienes los datos que crees tener :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41362
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ascan y tuplas

Postby goosfancito » Thu Jun 24, 2021 11:37 pm

Antonio Linares wrote:Prueba a usar:

SET EXACT ON
y SET DECIMALS TO ... también

Y para salir de dudas:

x := AScan( ::aTree, { | a | MsgInfo( a[ 5 ], oItem:cargo[ "hitem" ] ), .F. } )

asegurate visualmente que tienes los datos que crees tener :-)


https://drive.google.com/file/d/14baPwYLoK8De8CmGWw-z7Li4LzehZcfX/view?usp=sharing
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: ascan y tuplas

Postby Antonio Linares » Fri Jun 25, 2021 4:55 pm

Te aparece el que buscas ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41362
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ascan y tuplas

Postby goosfancito » Thu Jul 01, 2021 1:47 pm

buen dia.
no lo encuentra. esta en el array pero no lo encuentra.
si hago un for next... lo encuetnro, pero con ascan no.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 33 guests