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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To bottom of file

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I am issuinmg the following brow comman
Code:
BROW FIELDS DAYSALES.SALE_NUM, DAYSALES.DATE,DAYSALES.TIME,;
DAYSALES.CODE, DAYSALES.QTY, DAYSALES.EACH, METH FONT "verdana",12 
FOR DAYSALES.CODE = REFCODE TITLE TYTL NOAPPEND NOEDIT NODELETE
How do I get the record pointer on the last record, rather than the first?

Keith
 
I'd be more inclined to put after the Browse with the NOWAIT clause.
Code:
USE "c:\program files\brettonwoods\vstatus.dbf" SHARED
BROWSE FOR '255,255' $ st_ATTRIB NOWAIT 
GO bottom

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
I didn't saw it in Keith's question :)

Because I never used BROWSE in VFP (only in command window during the development process) I didn't spend so much time with HELP for BROWSE.

Borislav Borissov
 

Borislav,

I didn't saw it in Keith's question

It wasn't in Keith's question. I think Mike Gagnon was just giving an example from his own application. It's not really relevant to Keith's original question.

I never used BROWSE in VFP (only in command window during the development process)

Me too.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
It is
Code:
BROW FIELDS DAYSALES.SALE_NUM, DAYSALES.DATE,DAYSALES.TIME,;
DAYSALES.CODE, DAYSALES.QTY, DAYSALES.EACH, METH FONT "verdana",12
[b]FOR DAYSALES.CODE = REFCODE[/b] TITLE TYTL NOAPPEND NOEDIT NODELETE

Borislav Borissov
 
With a FOR clause, GO BOTTOM will of course cause the Browse to show the last record within the scope of the FOR.

BROWSE FOR doesn't work like a filter. You're restricting the scope of the browse but all other commands will operate on the whole table. As an extreme example,

BROWSE FOR...
DELETE ALL

will delete all records.

SET FILTER TO ...
DELETE ALL

will just delete the records which match the filter.


Geoff Franklin
 
Hi Keith,

Why not SELECT into a cursor, issue GO BOTTOM, and then jut BROWSE?

Regards,

Mike
 

Geoff,

That's why I was being careful in my choice of words. I said it will cause the Browse to show the last record within the scope of the FOR .

Regardless of where the record pointer is, the Browse will highlight the last record in its scope.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
BROWSE FOR ... will still start at the beginning of the record set you will be using, whether it be filtered or not, even if you've already issued a GO BOTTOM statement.

Issuing a BROWSE REST FOR ... will start from the current record pointer and continue on. But the problem with that is if you're at BOTTOM, you may be well past the record with the matching condition.

You may need to use a SEEK or LOCATE with SET NEAR ON to find the record last in line matching the condition, then do a BROWSE REST from that point.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Why so complicated? If you have an index you can set order ascending or descending and then have no need to go o the bottom.

If you want reverse physical order simply index on "two billion - recno()".

Then BROWSE FOR will again be at the first record, but as they are sorted in reverse physical order, on the bottom record matching the for clause.

Bye, Olaf.
 
You must have an index on daysales.code for this to work:
Code:
SET KEY TO REFCODE
BROW FIELDS DAYSALES.SALE_NUM, DAYSALES.DATE,DAYSALES.TIME,;
DAYSALES.CODE, DAYSALES.QTY, DAYSALES.EACH, METH FONT "verdana",12 
TITLE TYTL NOAPPEND NOEDIT NODELETE
SET KEY TO
The record pointer goes to the bottom.
 
The SELECT method looks like the baby but I will need to re-write some of the code round it.
This was written before I discovered SELECT so I was looking for a quick fix. Seems to be more of an issue than I first thought.
I am browsing a list of a particular sale items, the user moves to a record and then hits ESC to select it. Simple but effective but there are now too many records to start at the top each time.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top