need to create an array

need to create an array

Postby hag » Wed Jun 01, 2011 12:41 am

I want to create an array from a data base of a specific range of accounts. The accounts are the first field of the data base.
Some of the accounts may not exist so it needs to stop at the last number available in the range.
I don't know how to do this.
All help will be appreciated.

Thanks
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: need to create an array

Postby James Bott » Tue Jun 07, 2011 5:00 pm

Harvey,

Try something like this. I haven't tested it, cAlias may need to be surrounded by parens, and field(1) maybe doesn't need to be. My memory is a little foggy on this.

If you can't get it working, then send me a sample database, and I will.

James


Code: Select all  Expand view
local aAccounts:={}

select cAlias
set filter to ;
   cAlias->( field(1) ) >= cStartAcctNo .and. ;
   cAlias->( field(1) ) <= cEndAcctNo
   
cAlias->dbgotop()

do while ! cAlias->(eof())
   aadd( aAccounts, cAlias->(field(1)) )
   cAlias->(dbskip())
enddo
 
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: need to create an array

Postby hag » Tue Jun 07, 2011 8:37 pm

As always thanks for the in put.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 114 guests