I have an array created with
AaDd(aFrequeMax[nRuota],{massimo, &num})
then I have a number for a sample 42 and the nWheel 1
I must found the number 42 on aFrequeMax [nWheel] and return me the second element of this array
How I must make it ?
I tried with
AEval( aData, { |a| If( (a[1] = numero ), nFrequenza:=a[2] , nil ) } )
search a number of on array
- Silvio.Falconi
- Posts: 7164
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 2 times
search a number of on array
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: search a number of on array
Dear Silvio,
Please provide a drawing or something to better understand you
Please provide a drawing or something to better understand you

- Silvio.Falconi
- Posts: 7164
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 2 times
Re: search a number of on array
Antonio Linares wrote:Dear Silvio,
Please provide a drawing or something to better understand you
sample nWheel = 1

I have to find out if my number is in the first column, if it found it, return the value for the second column
For a sample my number is 66 it must return 594
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: search a number of on array
Code: Select all | Expand
function ArrLookUp( aArray, nSeek )
local nAt
if ( nAt := AScan( aArray, { |a| a[ 1 ] == nSeek } ) ) > 0
return aArray[ nAt, 2 ]
endif
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Silvio.Falconi
- Posts: 7164
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 2 times
Re: search a number of on array
thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com