FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour ascan y tuplas
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
ascan y tuplas
Posted: 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 (fw): Select all Collapse
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/
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: ascan y tuplas
Posted: Thu Jun 24, 2021 12:49 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: ascan y tuplas
Posted: Thu Jun 24, 2021 01: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/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ascan y tuplas
Posted: Thu Jun 24, 2021 02:38 PM

Prueba asi:

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: ascan y tuplas
Posted: Thu Jun 24, 2021 03:36 PM

ya lo he probado y tampoco.

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ascan y tuplas
Posted: Thu Jun 24, 2021 04: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
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: ascan y tuplas
Posted: 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/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: ascan y tuplas
Posted: Fri Jun 25, 2021 04:55 PM

Te aparece el que buscas ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: ascan y tuplas
Posted: Thu Jul 01, 2021 01: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/

Continue the discussion