Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

foxpro 2.6 browse display order

Status
Not open for further replies.

shoi

Technical User
Joined
Apr 14, 2001
Messages
3
Location
GB
Apologies for my ignorance

this is a BIG orders database 70K records, 30MB

what i want to do is display all orders from customer 12345 (there is an index file for this)
but then to display them in the browse window in CustomerOrderNumber order (again there is an index for this)


>>
set index to OISREF,OISCON (customer number , CustomerOrderNumber)

seek REFVAR (customer number)
if found()
GET_ORD=.t.
Skip 1
if REF(field f#holding customer number) = REFVAR
do while REF = REFVAR
skip
enddo
browse window OIBROW fields SURNAME:7,REF, etc noappend key "&REFVAR"
<<

I have messed around with SET ORDER TO without luck

do I need to create a new index combining the two fields, or is there a better way?

Thanks

Steve
 
You will only be able to browse in one order or the other, unless you do create a multi field index/tag.

But if your're only going to look at records for a certain customer number, you should be able to do something like:

Code:
set index to OISREF,OISCON
seek REFVAR (customer number)
if found()
   set index to OISCON, OISREF
   browse [COLOR=blue]REST [/color]window OIBROW ;
      fields SURNAME:7,REF, etc  noappend key "&REFVAR"
endif

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks for the assistance

foxpro help says
KEY <expr1> [, <expr2>]
.....
The table you
browse must be indexed, and the index key
value or values included in the KEY clause
must be the same data type as the index
expression of the master index file or master
tag.


which it isnt i think

certainly the browse shows no data
 
Actually, I think my method is wrong. I was typing on the fly and didn't test it.
You should be able to use a FOR clause instead. For example, if REFVAR contains '12345':
Code:
   browse REST window OIBROW ;
      fields SURNAME:7,REF, etc  noappend ;
      FOR OISREF = REFVAR

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top