creating array from DBF record

creating array from DBF record

Postby Ehab Samir Aziz » 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 ?
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Re: creating array from DBF record

Postby Enrico Maria Giordano » Sat Sep 16, 2006 10:02 am

Yes, you have to use AAdd() function.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby areang » 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
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests