FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour creating array from DBF record
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM

creating array from DBF record

Posted: Fri Sep 15, 2006 10:38 PM

can I form an array from DBF field records directly and put it as an ordinary array like this :

aDatos := { { "uno ", "dos ", "tres ", "cuatro", "cinco " },;
{ "Seis ", "Siete ", "Ocho ", "Nueve ", "Diez " } }

or should I do that module with aadd() function ?

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: creating array from DBF record

Posted: Sat Sep 16, 2006 10:02 AM

Yes, you have to use AAdd() function.

EMG

Posts: 128
Joined: Mon Jul 31, 2006 03:23 PM

creating array from DBF record

Posted: Sat Sep 16, 2006 10:33 AM

Try this

function LookAnimal()
local aData := {},oDlg

use animal
animal->(dbGotop())
do while !animal->(eof())
aadd( aData , animal->name )
animal->(dbSkip())
enddo
/
USE THIS ARRAY BY LISTBOX CLASS, you will get the names of animal from DBF
/

return nil

Areang

Continue the discussion