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

SET ORDER IN BROWSE

Status
Not open for further replies.

idontunderstand

Programmer
Jan 29, 2001
5
US

ELIEZER (PROGRAMMER)

&quot;SET ORDER TO <FIELD-NAME>&quot; ACTIVATE BY
&quot;ON KEY LABEL&quot; DURING THE BROWSE.

BUT:
1. SOMETIMES THE PREV. ORDER REMAIN.
2. SOMETIMES ITS CHANGE THE ORDER, BUT I'M STILL IN
MIDDLE OF THE FILE (WANT TO GO TO TOP).
THE COMMAND &quot;GO TOP&quot; DIDN&quot;T HELP.
IF I TYPE &quot;PAGE-UP&quot; ITS WORK, EVEN IF I DO
THE COMMAND - KEYB &quot;{PGUP}&quot;, ITS NOT WORK.
CAN YOU HELP ME.

THANKS,
ELIEZER SHTALMAN.
 
Eliezer,

1. Are you sure the index tag exist and the index file updated?

2. In fact, the instructions you describe won't refresh the browse window. You could try something like this:

ON KEY LABEL CTRL+F1 DO SetIndexTag
ON KEY LABEL CTRL+F2 DO SetIndexTag
ON KEY LABEL CTRL+F3 DO SetIndexTag

PROCEDURE SetIndexTag
lkey = LASTKEY()
DO CASE
CASE lkey = 94 && CTRL+F1 pressed
SET ORDER TO tag1
CASE lkey = 95 && CTRL+F2 pressed
SET ORDER TO tag2
CASE lkey = 96 && CTRL+F3 pressed
SET ORDER TO tag3
.....
ENDCASE
GO TOP
BROWSE LAST


Let us know if this helped! :)

David.
 
If you have tag names same as field names,
(good habit, I think)
you may try &quot;sort&quot; any browse through only one key
(&quot;context sensitive&quot;), e.g. F6
on key label F6 do srt_brow
...
proc srt_brow
vr = varread()
on error ?? chr(7)
set order to tag (vr)
on error do MyErrR with prog(), lineno()
brow last
keyb &quot;{CTRL+W}&quot;
retu
 
HI

Just replace your browse codes with ..

****************************************
inBrowse = .t.
ON KEY LABEL ctrl+N DO Ctrl_Key
ON ESCAPE STORE .f. TO inBrowse

DO WHILE inBrowse
BROWSE ...... && your browse command.
ENDDO

PROCEDURE Ctrl_key
search_exp = ''
cur_index = VAL(SYS(21))+1
IF EMPTY(TAG(cur_index))
cur_index = 1
ENDIF
key_val = EVAL(TAG(cur_index))
SET ORDER TO cur_index
GO TOP
SEEK key_val
RETURN
****************************************

Here the Available Indexes are cycled every time you press CTrn+N .. Also, the same record will be reached in the new order. Advantages, the user can view by Invoice number, then change to A/c No and ll invoices by that a/c, change to item code whatever....

Hope this helps :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 

T h a n k you very...

I also learn few new think from the answers.

Eliezer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top