FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour need to create an array
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM

need to create an array

Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: need to create an array

Posted: Tue Jun 07, 2011 05: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 (fw): Select all Collapse
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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM

Re: need to create an array

Posted: Tue Jun 07, 2011 08:37 PM

As always thanks for the in put.

Thank you

Harvey

Continue the discussion