$COMMAND
MENUS   
SET MESSAGE OFF
OPEN REC     
SET ERROR MESSAGE OFF
SET VAR PICK1  INT
LABEL STARTAPP
  NEWPAGE
  CHOOSE PICK1  FROM MAIN     IN MENUS.APX
  IF PICK1  EQ 1 THEN
    NEWPAGE
    DISPLAY HELP     IN MENUS.APX
    WRITE Press any key to continue 
    PAUSE
    GOTO STARTAPP
  ENDIF
  IF PICK1  EQ 0 THEN
    GOTO ENDAPP
  ENDIF
  IF PICK1  EQ            1 THEN
    SET VAR PICK2  INT
    SET VAR LEVEL2 INT
    SET VAR LEVEL2 TO 0
    WHILE LEVEL2 EQ 0  THEN
      NEWPAGE
      CHOOSE PICK2  FROM CDMENU   IN MENUS.APX
      IF PICK2  EQ 0 THEN
        BREAK
      ENDIF
      IF PICK2  EQ            1 THEN
        RUN CDUPDATE IN MENUS.APX
      ENDIF
      IF PICK2  EQ            2 THEN
        RUN CDINQ    IN MENUS.APX
      ENDIF
      IF PICK2  EQ            3 THEN
        RUN renum    IN MENUS.APX
      ENDIF
    ENDWHILE
    CLEAR LEVEL2
    CLEAR PICK2
    GOTO STARTAPP
  ENDIF
  IF PICK1  EQ            2 THEN
    RUN DIRSTUFF IN MENUS.APX
    GOTO STARTAPP
  ENDIF
  IF PICK1  EQ            3 THEN
    RUN EXIT     IN MENUS.APX
    GOTO STARTAPP
  ENDIF
  GOTO STARTAPP
LABEL ENDAPP
CLEAR PICK1
RETURN
$MENU
MAIN    
COLUMN SELECT DATA BASE
CD COLLECTION
CHRISTMAS CARD LIST
EXIT TO R:BASE
$MENU
CDMENU  
COLUMN UPDATE or INQUIRE
MANUAL MODE
INQUIRE ON CD DATA BASE
RENUMER CDs
$SCREEN 
HELP    
SELECT THE DATA BASE YOU WISH TO ACCESS
 
$COMMAND
DIRSTUFF
NEWPAGE
WRITE Opening DATABASE . . .
OPEN <DIR>DIR
SET NULL ?
SET LINES 26
LIST
QUIT
 
 
 
$COMMAND
EXIT    
SET NULL ?
QUIT
$COMMAND
CDUPDATE
NEWPAGE
WRITE Opening DATABASE . . .
OPEN <RECORDS>REC
SET MESSAGE ON
SET ERROR MESSAGE ON
SET NULL ?
SET LINES 26
LIST
QUIT
$COMMAND
CDINQ   
 
SET MESSAGE ON
SET ERROR MESSAGE ON
SET NULL ?
SET WIDTH 80
OPEN <RECORDS>REC
SET VAR PICK5  INT
SET ERROR VAR ev
LABEL STARTAPP
  NEWPAGE
  WRITE Find Artists, Songs or the Year of a song in the CD collection+
      at 2 10
  WRITE +
      AT 3 10
  WRITE Enter: at 5 10
  WRITE 1  To find songs by a particular ARTIST at 6 12
  WRITE 2  To find a song(s) by its TITLE at 7 12
  WRITE 3  To find songs by the YEAR they were popular at 8 12
  WRITE 0  When finished at 9 12
  WRITE Your choice             then press the [RETURN] or [GO] key at 11 10
  FILLIN PICK5 USING   AT 11 22
  IF PICK5  EQ 0 THEN
    GOTO ENDAPP
  ENDIF
  IF PICK5  EQ            1 THEN
    FILLIN WHVAL USING Enter all or part of the Artist's name  at 13 10
    NEWPAGE
    WRITE Please wait while I find information on the ARTIST 
    SHOW VAR WHVAL AT 1 52
    SELECT  +
      Artist     +
      Year=2     +
      POS=3      +
      LOC=3      +
      Song       +
      FROM CdSongs  +
      SORTED BY Song  Year  +
      WHERE Artist   CONT   .WHVAL
    IF ev NE 0 THEN
       WRITE No CDsSongs by that ARTIST
    ENDIF
    CLEAR WHVAL
    WRITE Press any key to continue 
    PAUSE
    GOTO STARTAPP
  ENDIF
  IF PICK5  EQ            2 THEN
    FILLIN WHVAL USING Enter all or part of a Song Title  at 13 10
    NEWPAGE
    WRITE Please wait while I find information on the SONG title 
    SHOW VAR WHVAL AT 1 56
    SELECT  +
      Song     +
      Year=2   +
      POS=3    +
      LOC=3    +
      Artist   +
      FROM CdSongs  +
      SORTED BY Song     Artist   Year     +
      WHERE Song     CON    .WHVAL
    IF ev NE 0 THEN
       WRITE No Songs like that on CD
    ENDIF
    CLEAR WHVAL
    WRITE Press any key to continue 
    PAUSE
    GOTO STARTAPP
  ENDIF
  IF PICK5  EQ            3 THEN
    FILLIN WHVAL USING What year? (YY) AT 13 10
    NEWPAGE
    WRITE Please wait while I find information on songs popular in 19   ...
    SHOW VAR WHVAL=2 AT 1 60
    SELECT  +
      Year=2+
      POS=3 +
      LOC=3 +
      Song  +
      Artist+
      FROM CdSongs  +
      SORTED BY Song     Artist   +
      WHERE Year     EQ     .WHVAL
    IF ev NE 0 THEN
       WRITE No SongsCDs for that year
    ENDIF
    CLEAR WHVAL
    WRITE Press any key to continue 
    PAUSE
    GOTO STARTAPP
  ENDIF
  IF PICK5  EQ 9 THEN
    SET MESSAGE ON
    SET ERROR MESSAGE ON
    QUIT
  ENDIF
  GOTO STARTAPP
LABEL ENDAPP
CLEAR PICK5
RETURN
 
 
 
 
 
 
 
$COMMAND
renum   
CLEAR ALL VARIABLES
SET MESSAGES OFF
SET ECHO ON
OPEN <RECORDS>REC
NEWPAGE
OUTPUT 1 WITH SCREEN
WRITE Building new SEQ file ....
PROJECT TMP FROM SEQ USING ALL SORTED BY LOC
REMOVE SEQ
 
RENAME TABLE TMP TO SEQ
WRITE Sorting and creating a new CDs file ...
PROJECT TMP FROM CDS USING ALL SORTED BY SORTNAME LOC
REMOVE CDS
 
RENAME TABLE TMP TO CDS
SET POINTER 1 status FOR seq
SET POINTER 2 FOR cds
WHILE status = 0 THEN
  SET VAR newloc TO loc IN 1
  SET VAR cdsloc TO loc IN 2
  SET VAR cdstitle TO title IN 2
  SHOW VAR CDSLOC;  SHOW VAR CDSTITLE
  SET MESSAGES ON; SET ECHO ON
  CHANGE loc TO newloc IN cds WHERE title EQ cdstitle AND loc EQ cdsloc
  CHANGE loc TO newloc IN cdsongs WHERE title EQ cdstitle AND loc EQ cdsloc
(*  SET ECHO OFF; SET MESSAGES OFF   )
  NEXT 1 status
  NEXT 2
ENDWHILE
OUTPUT SCREEN
QUIT
