_SCREEN.THEMES=.F. has appeared to have no effect. There's a couple of READs in there that seem to be ignored. What the program does (what's launched by FIRST BUTTON), is this (describing here):
b.prg is a small setup program that calls a far more elaborate secondary program called browmovd.prg. That in turn eventually calls another program named brwsrec.prg that launches a browse on a table, rec.dbf.
Embedded in these programs are a number of subroutines, I think their functionality should be pretty obvious. I'll paste in the code below, there are 3 PRGs: b.prg / browmovd.prg / brwsrec.prg
I'm trying to determine what's going on by stepping through the program. It would be easier if I disabled the isdouble routine, which, as I said previously, I don't believe I'm using these days anyway. b.prg is a brief setup routine, browmovd.prg does the "heavy lifting" and brwsrec.prg launches the browse window.
----> The code below is left-justified here, but if you want to see what's going on or are curious what I'm about here, you can copy/paste the stuff below into a Foxpro PRG and run BEAUTIFY to make it easier to comprehend. <----
The code:
***
* B.PRG
* 5/12/95
*** 10/22/2013 Note: The browse of rec.dbf has fields specified in brwsrec.prg. To change/add field(s), find the fields list and change there.
SET ESCAPE ON
*ON ESCAPE DO endbrws
ON KEY LABEL ESC DO endbrws && Just changed this. Better research this stuff. Don't know the fallout... 10-11-98
CLEAR
CLOSE DATA
SELE A
USE rec
SELE B
USE artist
SELE A && Rec
* Switch resolutions here [rem out one or the other]:
*DO BREC6X4 && Use this for 640 x 480 Resolution
*DO BROWSREC && Use this for 800 x 600 Resolution
DO browmovd && Moved stuff around
PROCEDURE endbrws
alldone=.T.
***************** END PROCEDURE b
**** BROWMOVD.PRG 1/9/96 BROWSREC.PRG ****
* DJ Database - Recordings information display screen
* Dan Musicant
* 12-17-94, 5/10/95, 8/17/96, 3/5/97
* Note: This is currently optimized for 800 x 600, and there is a version called BREC6X4.PRG
* that is optimized for 640 x 480, and it can be called instead by making a slight adjustment
* in b.prg
* NOTE: This program assumes Rec is open in the current work area and Artist
* is open
*-->Set up double click exit from browses (without saving)
ON KEY LABEL LEFTMOUSE DO ISDOUBLE && This is undone in the DO CASE of valid for left button bar of main DJ screen - v1.prg
PUBLIC M.CHK_SECS
M.CHK_SECS = SECONDS()
*-->
IF .NOT. USED("rec")
SELE 0
USE rec
ENDIF
IF .NOT. USED("artist")
SELE 0
USE artist
ENDIF
IF .NOT. USED("airec")
SELE 0
USE airec ORDER key
ELSE
SELE airec
SET ORDER TO key
SELE rec
ENDIF
SELE rec
* Setup
CLEAR
SET TALK OFF
SET ECHO OFF
SET HEADING OFF
SET DEVICE TO SCREEN
SET PRINT OFF
PRIVATE mchoice,mseen,mviewed,alldone,var,var2,was_sel,ldDate
mchoice=' '
mseen=.F.
mviewed=.F.
alldone=.F.
var=SPACE(1)
var2=SPACE(1)
ON KEY LABEL F10 DO djmain
ON KEY LABEL F8 DO flagme && at end of d.prg
ON KEY LABEL F7 DO mflagme && at end of d.prg
ON KEY LABEL F6 DO cflagme && at end of d.prg
DO WHILE .T.
IF alldone
EXIT && alldone is set to .T. by pressing F10 in browse -- see PROCEDURE djmain below
ENDIF && This allows exiting from a browse in this routine directly to the Main Menu.
var=SPACE(1)
var2=SPACE(1)
@ 6,49 SAY 'Browse Recordings Database'
@ 10,54 SAY 'Index?'
@ 24,0 CLEAR
@ 4,30 TO 36,97
@ 14, 44 SAY ' Artist'
@ 14, 65 SAY ' Plays'
@ 17, 44 SAY ' Title'
@ 17, 65 SAY ' Segues'
@ 20, 44 SAY ' Key'
@ 23, 44 SAY ' Flagg' &&
@ 23, 62 TO 34, 93
@ 24, 64 SAY ' Press F10 from BROWSE to'
@ 26, 64 SAY ' go directly to Main Menu.'
@ 26, 44 SAY ' Album' && I did have "None" here, but changed it to Album 11.14.2010. Changed hotkey from N to M. Seems to be working now.
@ 29, 44 SAY ' View'
@ 32, 44 SAY ' Exit'
@ 30, 64 SAY ' Press F4 from BROWSE to'
@ 32, 64 SAY ' flag or unflag an artist.'
@ 13,39 GET var PICTURE '@*VT \<A;\<T;\<K;\<F;\<M;\\\<V;\<X' SIZE 2,5,1
@ 13,60 GET var2 PICTURE '@*VT \<P;\<S' SIZE 2,5,1
@ 12,79 GET airectype FUNCTION '*RNV Current;All-Date;All-Key' SIZE 1, 10, 1 DEFAULT 'Current' && Radio buttons (3)
IF mseen=.T.
@ 13,39 GET var PICTURE '@*VT \<A;\<T;\<K;\<F;\<M;\<V;\<X' SIZE 2,5,1
@ 13,60 GET var2 PICTURE '@*VT \<P;\<S' SIZE 2,5,1
@ 12,79 GET airectype FUNCTION '*RNV Current;All-Date;All-Key' SIZE 1, 10, 1 DEFAULT 'Current'
ENDIF
ON KEY LABEL ctrl+w KEYBOARD '{X}'
READ && READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ READ
ON KEY LABEL ctrl+w
DO CASE
CASE .NOT. var=SPACE(1)
mchoice=var
CASE .NOT. var2=SPACE(1)
mchoice=var2
ENDCASE
IF mchoice=' '
mchoice='N'
ENDIF
DO WHILE .NOT. mchoice$'ATKFNMEXVPS'
mchoice=' '
*@ 10, 63 GET mchoice PICTURE '!'
IF mseen=.T.
@ 13,39 GET var PICTURE '@*VT \<A;\<T;\<K;\<F;\<M;\<V;\<X' SIZE 2,5,1
@ 13,60 GET var2 PICTURE '@*VT \<P;\<S' SIZE 2,5,1
@ 12,79 GET airectype FUNCTION '*RNV Current;All-Date;All-Key' SIZE 1, 10, 1 DEFAULT 'Current'
ELSE
@ 13,39 GET var PICTURE '@*VT \<A;\<T;\<K;\<F;\<M;\\\<V;\<X' SIZE 2,5,1
@ 13,60 GET var2 PICTURE '@*VT \<P;\<S' SIZE 2,5,1
@ 12,79 GET airectype FUNCTION '*RNV Current;All-Date;All-Key' SIZE 1, 10, 1 DEFAULT 'Current'
ENDIF
ON KEY LABEL ctrl+w KEYBOARD '{X}'
READ
ON KEY LABEL ctrl+w
DO CASE
CASE .NOT. var=SPACE(1)
mchoice=var
CASE .NOT. var2=SPACE(1)
mchoice=var2
ENDCASE
ENDDO
*IF ! var=SPACE(1)
* mchoice=var
*ENDIF
@ 10,0
DO CASE
CASE mchoice='N'
SET ORDER TO
*BROW PREFERENCE NONE FONT 'MS Sans Serif', 8 STYLE 'N' = = =
IF NOT USED('REC')
USE REC IN 0
SELE REC
GO BOTT
ELSE
SELE REC
SET ORDER TO
GO BOTT
ENDIF
do brwsrec with '
DO pflagg
USE IN rec
mseen=.T.
CLEAR
CASE mchoice$'EX'
EXIT
OTHERWISE
CLEAR
msearch=SPACE(25)
@ 4,30 TO 36,95
@ 6,49 SAY ' Browse Recordings Database'
DO CASE
CASE mchoice='A'
@ 9,51 SAY 'Index on Artist'
@ 17,34 SAY 'To view current artist:'
@ 19,40 SAY '---> Enter blank for Recordings'
@ 21,40 SAY '---> Enter "CA" for Artists'
@ 25,34 SAY 'To search ARTISTS Database enter "ART" or "AA"'
@ 27,46 SAY '[argument only]'
@ 31,34 SAY 'To search ARTISTS Database enter "ART ALL" or "A A"'
@ 33,46 SAY '[entire database]'
CASE mchoice='T'
@ 10,51 SAY 'Index on Title'
@ 16,51 SAY 'Display titleprint field?'
CASE mchoice='K'
@ 10,51 SAY 'Index on Key'
CASE mchoice='F'
@ 10,51 SAY 'Index on flagg'
CASE mchoice='M'
@ 10,51 SAY 'Index on Album'
CASE mchoice='V'
EDIT
mviewed=.T.
CASE mchoice='S'
DO segues
mviewed=.T.
CASE mchoice='P'
SELE airec
SEEK rec.key
IF FOUND()
DO CASE
CASE airectype='Current'
*** BROWSE KEY rec.key NODELETE NOAPPEND NOEDIT && Visual FoxPro (all versions) have been tanking on this line!!
* Changing this so I can see more info, for instance whether there is a recording of this show, the track title. 4/17/2008
*!* SET FILTER TO KEY=REC.key
*!* BROWSE NODELETE NOAPPEND NOEDIT
*!* SET FILTER TO
PRIVATE keycurval
keycurval = rec.key
*title, date, time, tapes, set_num, select_num, feature, request, comments
SELECT rec.title, airec.date, airec.time, SHOW.tapes, set_num, select_num, airec.feature, request, airec.comments, airec.key ;
FROM rec, show, airec WHERE airec.key=keycurval AND show.date=airec.date AND rec.key=airec.key ORDER BY airec.date INTO CURSOR cplayed
BROWSE
RELEASE keycurval, cplayed
CASE airectype='All-Date'
SET ORDER TO datesort && = = = =
* * * *
* New code 8/10/00
ldDate=airec.date
* COPY TO tempview
* wassel=SELECT()
* SELECT 0
* use tempview
*SELECT rec.artist, rec.title,rec.flagg,rec.airplay,rec.play,rec.evaluation,rec.format,;
*rec
was_sel=SELECT()
SELECT 0
*SELECT rec.artist, rec.title,rec.flagg,rec.airplay,rec.play,rec.evaluation,rec.format, ;
*rec.comments,rec.album, ldDate as showdate, allt(str(airec.set_num))+'/'+allt(str(airec.select_num)) ;
*as ordplayed FROM rec,airec WHERE rec.key=airec.key and airec.date=ldDate INTO TABLE viewshow
SELECT PROPER(rec.artist), PROPER(rec.title),rec.flagg,rec.airplay,rec.play,rec.evaluation,rec.format, ;
rec.comments,PROPER(rec.album), ldDate as showdate, airec.set_num+(1/10)*airec.select_num ;
as ordplayed FROM rec,airec WHERE rec.key=airec.key and airec.date=ldDate INTO TABLE viewshow
index on ordplayed tag ordplayed
BROWSE LAST
USE
SELECT (was_sel)
* * * *
*BROWSE
SET ORDER TO key
CASE airectype='All-Key'
BROWSE
ENDCASE
ELSE
?? alert("There is no record of this selection being played.","OK",.T.)
ENDIF
SELE rec
mviewed=.T.
ENDCASE
@ 4,30 TO 36,95
IF .NOT. mviewed=.T.
@ 13,40 SAY 'Search? ' GET msearch PICTURE '@!'
ON KEY LABEL ctrl+w mchoice='{CutOut of this!}'
READ && 11.3.15 Adding radio buttons (2) Show all and filter out 'P ' in tandem with 'DAD' (only want to see 'PD'
ON KEY LABEL ctrl+w
ENDIF
IF LASTKEY()=27 && You pressed ESC
mchoice='CutOut of this!'
ENDIF
mviewed=.F.
@ 10,0
@ 14,0
@ 24,28
* ????@ 41,0 CLEA
@ 4,30 TO 36,95
CLEAR && Saves having to view the left over screen when closing direct to Main Menu.
DO CASE
CASE mchoice='CutOut of this!' && You decided not to browse after all and pressed ESC
EXIT
CASE mchoice='A' &&= =???????????????????????????????????????????????
DO WHILE .T.
IF UPPER(msearch)='ART ' .OR. UPPER(msearch)='AA '
msearch=SPACE(25)
@ 13,36 SAY 'Search on? ' GET msearch PICTURE '@!'
READ
SELE artist
SET ORDER TO artist
SEEK ALLTRIM(msearch)
IF FOUND()
BROW PREFERENCE artist FONT 'MS Sans Serif', 8 STYLE 'N' KEY ALLTRIM(msearch)
SELE rec
DO pflagg
ELSE
SELE rec
ENDIF
mseen=.T.
CLEA
EXIT
ENDIF
IF ALLTRIM(UPPER(msearch))='ART ALL' .OR. ALLTRIM(UPPER(msearch))='A A'
msearch=SPACE(25)
@ 6,39 SAY ' Browse Artists Database '
@ 13,40 SAY 'Search on? ' GET msearch PICTURE '@!'
READ
*@ 12,0 CLEAR
SELE artist
SET ORDER TO artist
SEEK ALLTRIM(msearch)
IF FOUND()
BROW PREFERENCE artist FONT 'MS Sans Serif', 8 STYLE 'N'
SET ORDER TO
SELE rec
DO pflagg
ELSE
SET ORDER TO
SELE rec
ENDIF
mseen=.T.
CLEA
EXIT
ENDIF
IF UPPER(msearch)='CA '
msearch=SPACE(25)
@ 6,39 SAY ' Browse Artists Database '
SELE artist
SET ORDER TO artist
SEEK rec.artist
IF FOUND()
BROW PREFERENCE artist FONT 'MS Sans Serif', 8 STYLE 'N'
SET ORDER TO
SELE rec
DO pflagg
ELSE
SET ORDER TO
SELE rec
ENDIF
mseen=.T.
CLEA
EXIT
ENDIF
SET ORDER TO artist
IF .NOT. msearch=' '
SEEK ALLTRIM(msearch)
IF FOUND()
ON KEY LABEL F4 DO hex
*BROW PREFERENCE artist FONT 'MS Sans Serif', 8 STYLE 'N'
DO brwsrec WITH 'artist'
ON KEY LABEL F4
SET ORDER TO
SELE rec
DO pflagg
ELSE
SET ORDER TO
SELE rec
ENDIF
ELSE && No search argument...go to any record -- pick a *random* one
IF .NOT. mseen
GOTO MOD(VAL(SYS(3)),RECCOUNT()) && Picks a random record if no search argument
ENDIF
ON KEY LABEL F4 DO hex
*BROW PREFERENCE KEY FONT 'MS Sans Serif', 8 STYLE 'N'
DO brwsrec WITH 'artist'
ON KEY LABEL F4
SET ORDER TO
SELE rec
DO pflagg
ENDIF
mseen=.T.
CLEAR
EXIT
ENDDO
@ 14,0 CLEAR
CASE mchoice='T'
SET ORDER TO TITLE
IF .NOT. msearch=' '
SEEK ALLTRIM(msearch)
IF FOUND()
*BROW PREFERENCE TITLE FONT 'MS Sans Serif', 8 STYLE 'N'
DO brwsrec WITH 'title','title'
DO pflagg
ENDIF
ELSE
*BROW PREFERENCE TITLE FONT 'MS Sans Serif', 8 STYLE 'N'
do brwsrec with 'title','title'
DO pflagg
ENDIF
mseen=.T.
CLEAR
CASE mchoice='M'
SET ORDER TO album
IF .NOT. msearch=' '
SEEK ALLTRIM(msearch)
IF FOUND()
*BROW PREFERENCE TITLE FONT 'MS Sans Serif', 8 STYLE 'N'
DO brwsrec WITH 'album','album'
DO pflagg
ENDIF
ELSE
*BROW PREFERENCE TITLE FONT 'MS Sans Serif', 8 STYLE 'N'
do brwsrec with 'album','album'
DO pflagg
ENDIF
mseen=.T.
CLEAR
CASE mchoice='K'
SET ORDER TO KEY
IF .NOT. msearch=' '
SEEK ALLTRIM(msearch)
IF FOUND()
SET ORDER TO artist
*BROW PREFERENCE KEY FONT 'MS Sans Serif', 8 STYLE 'N'
DO brwsrec WITH 'key','key'
DO pflagg
ENDIF
ELSE
SET ORDER TO artist
*BROW PREFERENCE KEY FONT 'MS Sans Serif', 8 STYLE 'N'
DO brwsrec WITH 'key','key'
DO pflagg
ENDIF
mseen=.T.
CLEAR
CASE mchoice='F' && Defaults to "P" search if left blank
SET ORDER TO flagg
IF UPPER(ALLTRIM(msearch))='P'
*-----fix flagg's, for wrong position, wrong case
SEEK ' p'
IF FOUND()
DO WHILE flagg = ' p'
REPL flagg WITH 'P '
ENDDO
ENDIF
SEEK 'p '
IF FOUND()
DO WHILE flagg = 'p '
REPL flagg WITH 'P '
ENDDO
ENDIF
ENDIF
IF .NOT. msearch=' '
SEEK ALLTRIM(msearch)
IF FOUND()
*BROW PREFERENCE flagg FONT 'MS Sans Serif', 8 STYLE 'N'
do brwsrec with 'flagg','flagg'
DO pflagg
ENDIF
ELSE
SEEK 'P '
*BROW PREFERENCE flagg FONT 'MS Sans Serif', 8 STYLE 'N'
IF FOUND()
*** Jump some records, specifically about 1/2 the number of flagged entries so scrolling is less necessary to see them all 4/12/12
PRIVATE lnRecno, lnCount, lnSkip
lnCount=1
lnRecno=RECNO()
DO WHILE flagg='P'
SKIP
lnCount=lnCount+1
ENDDO
lnSkip=INT(lnCount/2)
GO lnRecno
SKIP lnSkip
RELEASE lnRecno, lnCount, lnSkip
***END Jump some records, specifically about 1/2 the number of flagged entries so scrolling is less necessary to see them all 4/12/12
do brwsrec with 'flagg','flagg'
DO pflagg
ENDIF
ENDIF
mseen=.T.
CLEAR
ENDCASE
ENDCASE
mchoice=' '
ENDDO
CLEAR
ON KEY LABEL TAB
RETURN && NOTE THAT DATABASES ARE STILL OPEN (REC, ARTIST, ?) LINE 174, 7/95
*****************************************************
PROCEDURE pflagg
IF UPPER(SUBSTR(flagg,2))='P'
REPL flagg WITH 'P'+SUBSTR(flagg,1,1)
ENDIF
IF UPPER(SUBSTR(flagg,1,1))='P'
REPL flagg WITH 'P'+SUBSTR(flagg,2)
ENDIF
*****************************************************
PROCEDURE segues
CLEAR
PRIVATE record
record=SET("ORDER")
IF .NOT. USED("airec")
SELE 0
USE airec ORDER key
ELSE
SELE airec
SET ORDER TO key
SELE rec
ENDIF
SELE rec
SET ORDER TO key && in Rec
PRIVATE len1, len2
STORE 0 TO len1, len2
PRIVATE recnumber
recnumber=RECNO()
SELE airec
PRIVATE playnumb
playnumb=1
PRIVATE reckey
reckey=rec.key
PRIVATE airecnum
SEEK reckey
PRIVATE rownum
rownum=0
PRIVATE before, beforenms
PRIVATE heading
heading=' '+ALLTRIM(PROPER(rec.artist))+': '+ALLTRIM(PROPER(rec.title))
? heading
?
IF FOUND()
DO WHILE key=reckey
airecnum=RECNO()
*!* SET ORDER TO DATE && datesort?? 07/06/03
SET ORDER TO datesort
SKIP -1
SELE rec
SEEK airec.key
? ' Play '+ALLTRIM(STR(playnumb))+' '+DTOC(airec.date)
?
before=' Before: '+ALLTRIM(PROPER(artist))+': '+ALLTRIM(PROPER(title))
beforenms=ALLTRIM(STR(airec.set_num))+' '+ALLTRIM(STR(airec.select_num))
len1=LEN(before)
SELE airec
SKIP 2
SELE rec
SEEK airec.key
len2=LEN(' After: '+ALLTRIM(PROPER(artist))+': '+ALLTRIM(PROPER(title)))
pad=MAX(len1,len2)+4
?? before
@ ROW(),pad SAY beforenms
?
?
?? ' After: '+ALLTRIM(PROPER(artist))+': '+ALLTRIM(PROPER(title))
@ ROW(),pad SAY ALLTRIM(STR(airec.set_num))+' '+ALLTRIM(STR(airec.select_num))
SELE airec
SKIP -1
SET ORDER TO key
SKIP
playnumb=playnumb+1
?
rownum=rownum+6
IF rownum>40
WAIT
CLEAR
rownum=0
? heading
?
ENDIF
ENDDO
ENDIF
SELE rec
SET ORDER TO &record
GOTO recnumber
WAIT
CLEAR
ON KEY LABEL F10
ON KEY LABEL F8
ON KEY LABEL F7
ON KEY LABEL F6
RETURN
*-->End PROCEDURE segues
*****************************************************
PROCEDURE djmain
*-->Exits (and saves) from a browse (of rec.dbf) and returns directly to the main menu.
ON KEY LABEL F10
alldone=.T. && the alldone causes exiting from the large DO WHILE loop above.
KEYBOARD "{CTRL + W}"
*****************************************************
* Moved flagme, etc. to end of d.prg 7-6-98
*****************************************************
PROCEDURE hex
PRIVATE wasart
wasart=ALLT(rec.artist)
SEEK wasart
PRIVATE washex
IF CHR(31)$flagg
washex=.t.
ELSE
washex=.f.
ENDIF
IF washex
DO WHILE allt(artist) == allt(wasart)
repl flagg with strtran(flagg,CHR(31))
skip
ENDDO
ELSE
DO WHILE allt(artist) == allt(wasart)
REPL flagg WITH allt(flagg)+CHR(31)
skip
ENDDO
ENDIF
SKIP -1
*****************************************************
PROCEDURE isdouble
* A new unmodified version of this is in DJ <---
* I hacked this to work in this program. The essential thing is to initiate new_sec at top, erase the on key assignment.
* this procedure will browse a table. if the mouse is double-clicked it
* will close the browse without saving. change the name of the file to
* be used and play with the values of the double-click to get the right fit.
*get the current seconds
*M.CHK_SECS = SECONDS() && Moving this line to top of browmovd.prg
*get the old double click value
OLD_DOUBLE = _DBLCLICK
*set it to whatever you want
* _DBLCLICK = .25
_DBLCLICK = .19 && .25 was really a problem, closing the browse when I just want to scroll
*open up a file to browse. change to a database table in your directory
***USE datatabl
*set the on key label for the left mouse to check if double clicked
* ON KEY LABEL LEFTMOUSE DO ISDOUBLE
*browse the file
**BROWSE LAST
*reset the on key label leftmouse
***ON KEY LABEL LEFTMOUSE
*reset the double click value
**_DBLCLICK = OLD_DOUBLE
*****************
*FUNCTION ISDOUBLE
*****************
*what is the current time in seconds
NEW_SEC = SECONDS()
*is the new click within the range of the double click?
IF NEW_SEC <= M.CHK_SECS + _DBLCLICK
*it was, close the browse window
KEYBOARD "{CTRL + Q}"
ENDIF
M.CHK_SECS = NEW_SEC
_DBLCLICK = OLD_DOUBLE
RETURN .T.
*****************
PROCEDURE progexit
var='X'
RETURN
*********************** END PROCEDURE browmovd
PROCEDURE brwsrec
PARAMETERS myord,lcbrowpref,fltcommand
* See brec.prg for a command window version.
* This procedure sets up VALIDation and/or WHEN clause functions by specifying the field list.
* It's nice, and it returns you where and as you were.
* If Rec was open, it is left where it was and as it was. However, the browse will be as configured by the 3 parameters:
* If myord is not specified, Artist is the order.
* If myord="", then no order is in effect. If specified, lcbrowpref specifies the Preference. If unspecified,
* then the Standard Preference is in effect.
* Enhanced 10-22-98 such that order is toggled by a right mouse click. If originally Artist or Title, it toggles ;
between them. IF a different tag, between all three.
PRIVATE wassel, wasord, m_out, mTitle, flt
flt=.F.
IF PARAMETERS()=3
flt=.T.
ENDIF
m_out=.T.
DO setkeys
wassel=SELECT(0)
IF TYPE('myord')='L'
myord='ARTIST'
ENDIF
IF TYPE('lcbrowpref')='L'
lcbrowpref='standard'
ENDIF
IF NOT USED('rec')
jlwasused=.F.
USE rec ORDER (myord) IN 0
ELSE
SELECT rec
wasord=ORDER()
jlwasused=.T.
ENDIF
SELECT rec
SET ORDER TO (myord)
IF flt
SET FILTER TO &fltcommand
ENDIF
ON KEY LABEL RIGHTMOUSE DO reorder && Enables changing displayed order within BROWSE on the fly.
DO WHILE .T.
m_out=.T.
mTitle='Microsoft FoxPro ' + ' - Order '+ORDER()
MODIFY WINDOW SCREEN;
FONT "MS Sans Serif",9;
STYLE "B";
TITLE (mTitle)
BROWSE FIELDS artist,TITLE,album,flagg :W=dlmouse(),o,airplay,PLAY,evaluation,FORMAT,comments,album,theme,genre, ;
fundraiser,flaggg,flagggg,vocalist,segues,SECTION,cover,notes,KEY,artist_id,label ;
PREFERENCE (lcBrowPref) ;
FONT "MS Sans Serif" ,8 STYLE "N"
IF m_out
EXIT
ENDIF
ENDDO
ON KEY LABEL RIGHTMOUSE
DO CASE
CASE '2.6a'$VERSION()
MODIFY WINDOW SCREEN TITLE 'Microsoft FoxPro 2.6a'
CASE '7.0'$VERSION()
MODIFY WINDOW SCREEN TITLE 'Microsoft Visual FoxPro 7.0'
CASE '6.0'$VERSION()
MODIFY WINDOW SCREEN TITLE 'Microsoft Visual FoxPro 6.0'
CASE '5.0'$VERSION()
MODIFY WINDOW SCREEN TITLE 'Microsoft Visual FoxPro 5.0'
CASE '3.0'$VERSION()
MODIFY WINDOW SCREEN TITLE 'Microsoft Visual FoxPro 3.0'
ENDCASE
SET ORDER TO (myord)
IF !jlwasused
USE IN rec
ELSE
SET ORDER TO (wasord)
ENDIF
SELE (wassel)
DO unsetkeys
RETURN
*****************************************************
FUNCTION reorder
* Adapted from ans.prg 10-22-98
DO CASE
CASE ORDER()='ARTIST'
SET ORDER TO TITLE
CASE ORDER()='TITLE'
IF (UPPER(myord)='ARTIST' OR UPPER(myord)='TITLE')
SET ORDER TO 'ARTIST'
ELSE
SET ORDER TO (myord)
ENDIF
OTHERWISE
SET ORDER TO artist
ENDCASE
m_out=.F.
KEYBOARD "{CTRL+W}"
***************************************************** Place :W,:V functions, ON KEY assignments below.
PROCEDURE setkeys
RETURN
*****************************************************
PROCEDURE unsetkeys
RETURN
*****************************************************
FUNCTION dlmouse
IF MDOWN()
IF 'P'$FLAGG
REPLACE flagg WITH UPPER(flagg)
REPL FLAGG WITH ALLTRIM(STRTRAN(flagg,'P',' '))
ELSE
IF !o
REPLACE flagg WITH UPPER(flagg)
REPL FLAGG WITH 'P'+ALLTRIM(flagg)
ENDIF
ENDIF
ENDIF
RETURN .T.
*****************************************************
*****************************************************
*****************************************************
*****************************************************
*****************************************************