Create a array from dbfs

Create a array from dbfs

Postby Silvio.Falconi » Wed Dec 07, 2016 10:17 am

I wish create a telephon list ( temporaney array) from two archives dbf but I not Know How make it

Is There is a function to create array from databases or I must create it to hand ?
the field are the same only change the prefix init ( CL or PR)
sample

customer : CLNOMBRE
farmer : PRNOMBRE

When I have the array I wish a alphabetic order from a to z ( with tabs)

I saw something in this forum but I not remember where
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Re: Create a array from dbfs

Postby karinha » Wed Dec 07, 2016 2:41 pm

Maybe:

Code: Select all  Expand view

   ASORT(MATRIZ,,,{ |Z,W| Z[1]+Z[2] < W[1]+W[2] }
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7613
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Create a array from dbfs

Postby karinha » Wed Dec 07, 2016 2:53 pm

Examples:

Code: Select all  Expand view

LOCAL aVetor := { “A”, “D”, “C”, “B” }
LOCAL aArray := { 3, 5, 1, 2, 4 }
 
ASORT(aVetor)                          // Resulta: { “A”, “B”, “C”, “D” }
ASORT(aVetor,,, { |x, y| x > y } )     // Resulta: { “D”, “C”, “B”, “A” }
 
ASORT(aArray)                          // Resulta: { 1, 2, 3, 4, 5 }
ASORT(aArray,,, { |x, y| x > y } )     // Resulta: { 5, 4, 3, 2, 1 }
 
 
Este exemplo ordena o segundo elemento de um array de duas dimensões:
 
LOCAL aIndice := { { “Fipe”, 9.3 }, { “IPC”, 8.7 }, { “DIEESE”, 12.3 } }
 
ASORT(aIndice, , , { | x,y | x[2] > y[2] } )
 
// Com base na ordenação acima, a ordem fica:
// DIEESE     12.3
// Fipe        9.3
// IPC         8.7
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7613
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano, Google [Bot] and 50 guests