dbTalk Databases Forums  

display order in browser window FP2.6

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss display order in browser window FP2.6 in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Hayes
 
Posts: n/a

Default display order in browser window FP2.6 - 09-07-2004 , 09:54 AM






First of all apologies for my ignorance
foxpro dos 2.6

we have a sales orders database, it's BIG 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)


Quote:
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


Reply With Quote
  #2  
Old   
lemmebe@frednwilma.com
 
Posts: n/a

Default Re: display order in browser window FP2.6 - 09-07-2004 , 06:56 PM






On 7 Sep 2004 07:54:26 -0700, steveh (AT) outsidein (DOT) co.uk (Steve Hayes) wrote:

Have you thought about something more simple, like:

Select * ;
from orders ;
into cursor salesorders ;
where oisref = "12345" ;
order by oiscon

The browse then should be automatic.

Alan

Quote:
First of all apologies for my ignorance
foxpro dos 2.6

we have a sales orders database, it's BIG 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
My real address is alan at sprint dot ca
(with a 'p' on 'alan' making it 'alanp',
and no spaces). I'm sick of email spam.


Reply With Quote
  #3  
Old   
lemmebe@frednwilma.com
 
Posts: n/a

Default Re: display order in browser window FP2.6 - 09-07-2004 , 07:10 PM



On 7 Sep 2004 07:54:26 -0700, steveh (AT) outsidein (DOT) co.uk (Steve Hayes) wrote:

Sorry, my bad. When i Responded before, I typed too fast. Selecting into a
cursor will not automatically display a browse. You have to give it the
command. Selecting without 'into cursor ' will automatically browse.

Alan

Quote:
First of all apologies for my ignorance
foxpro dos 2.6

we have a sales orders database, it's BIG 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
My real address is alan at sprint dot ca
(with a 'p' on 'alan' making it 'alanp',
and no spaces). I'm sick of email spam.


Reply With Quote
  #4  
Old   
Alexandre Peshansky
 
Posts: n/a

Default Re: display order in browser window FP2.6 - 09-10-2004 , 04:23 PM



On 7 Sep 2004 07:54:26 -0700, steveh (AT) outsidein (DOT) co.uk (Steve Hayes) wrote:
[ Courtesy cc'ed through e-mail to the quoted author ]

Quote:
First of all apologies for my ignorance
foxpro dos 2.6

we have a sales orders database, it's BIG 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
Steve,
the simplest would be
SET ORDER TO oiscon
BROWSE ... FOR <cust_number>=refvar

As you have indexes on both customer order number and customer number, it will
be fast, too.
--
[ When replying, remove *'s from address ]
Alexandre Peshansky, Systems Manager, RUH, NY


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.