
* Program..: VI-MAIN.CMD
* Author...: Lyle Burks
* Date.....: 06/07/85
* Notice...: Copyright 1985, All Rights Reserved
* Reserved.: select, selectnum, editchoice, poschoice,
*            error, findkey, expression, string, is:eof
*            clearline, addchoice, is:some, lastrecord
*
SET TALK OFF
SET BELL OFF
SET COLON OFF
* ---Use blanks to clear-to-end-of-line.
STORE $(STR(0,81),1,80) TO clearline

DO WHILE T

ERASE
@  1, 0 SAY "========================================"
@  1,40 SAY "========================================"
@  2, 0 SAY "||"
@  2,21 SAY "V I D E O L O G    M A I N    M E N U"
@  2,78 SAY "||"
@  3, 0 SAY "========================================"
@  3,40 SAY "========================================"
@  4, 0 SAY "||"
@  4,78 SAY "||"
@  5, 0 SAY "||"
@  5,78 SAY "||"
@  6, 0 SAY "||"
@  6,78 SAY "||"
@  7, 0 SAY "||"
@  7,78 SAY "||"
@  8, 0 SAY "||"
@  8,78 SAY "||"
@  9, 0 SAY "||"
@  9,78 SAY "||"
@ 10, 0 SAY "||"
@ 10,78 SAY "||"
@ 11, 0 SAY "||"
@ 11,78 SAY "||"
@ 12, 0 SAY "========================================"
@ 12,40 SAY "========================================"
@  5,35 SAY " 0. exit"
@  6,35 SAY " 1. view"
@  7,35 SAY " 2. add"
@  8,35 SAY " 3. edit"
@  9,35 SAY " 4. pack"
@ 10,35 SAY " 5. list"
@ 11,35 SAY " 6. labels"
STORE 7 TO selectnum
DO WHILE selectnum < 0 .OR. selectnum > 6
   STORE " " TO select
   @ 14,33 SAY " select : : "
   @ 14,42 GET select PICTURE "#"
   READ
   STORE VAL(select) TO selectnum
ENDDO

DO CASE
   CASE selectnum= 0
      CLEAR
      SET COLON ON
      SET BELL ON
      SET TALK ON
      RETURN
   CASE selectnum= 1
   *  DO view
      USE VIDEOLOG INDEX VIDTITLE
      ERASE
      @ 1, 0 SAY "V I E W    V I D E O L O G"
      @ 1,72 SAY DATE()
      DO VI-frame
      IF # = 0
         * ---The data file is empty.
         STORE " " TO select
         @ 14,0 SAY "EMPTY DATA FILE"
         @ 15,0 SAY "Strike any key to continue...";
                GET select
         READ NOUPDATE
      ELSE
         * ---The data file contains records.
         DO VI-gets
         CLEAR GETS
         STORE "X" TO poschoice
         DO WHILE poschoice <> " "
            DO VI-posn
         ENDDO
      ENDIF
      USE
   CASE selectnum= 2
   *  DO add
      USE VIDEOLOG INDEX VIDTITLE
      COPY STRUCTURE TO VIDEOLOG.add
      SELECT SECONDARY
      USE VIDEOLOG.add
      ERASE
      @ 1, 0 SAY "A D D    V I D E O L O G"
      @ 1,72 SAY DATE()
      DO VI-frame
      @ 14,0 SAY "Press <control-W> to exit"
      STORE "X" TO addchoice
      DO WHILE addchoice <> " "
         APPEND BLANK
         DO VI-gets
         READ
         * ---TITLE cannot be blank.
         STORE TRIM( TITLE ) TO addchoice
      ENDDO
      DELETE
      USE
      SELECT PRIMARY
      APPEND FROM VIDEOLOG.add
      USE
   CASE selectnum= 3
   *  DO edit
      USE VIDEOLOG INDEX VIDTITLE
      ERASE
      @ 1, 0 SAY "E D I T    V I D E O L O G"
      @ 1,72 SAY DATE()
      DO VI-frame
      IF # = 0
         * ---The data file is empty.
         STORE " " TO select
         @ 14,0 SAY "EMPTY DATA FILE"
         @ 15,0 SAY "Strike any key to continue...";
                GET select
         READ NOUPDATE
      ELSE
         * ---The data file contains records.
         DO VI-gets
         CLEAR GETS
         DO VI-edit
      ENDIF
      USE
   CASE selectnum= 4
   *  DO pack
      DO VI-pack
   CASE selectnum=5
   *  DO list
      DO VI-list
   CASE selectnum=6
   *  DO labels
      DO vidlabel
ENDCASE

ENDDO T
* EOF: VI-MAIN.CMD
