$! SYSDOC.COM - Documentation Management System $! $! Date: 10-Jun-93 - V 2.10 $! Desc: $! SYSDOC is a simplistic documentation management $! system. It provides the ability to access site specific $! documentation on-line, and to print hardcopy versions. $! $! SYSDOC.COM - provides on-line access to documentation allowing $! you to EDIT, TYPE, or PRINT individual documents $! $! This procedure allows you to traverse the directory tree $! which contains documentation sections and documents. $! $! Sections are .DIR files that are contained at the top of the $! directory tree (TASM$DOC). When you first invoke SYSDOC you $! are presented with a menu $! with a sequential number next to each section that can be $! selected. When a number is selected, the current default $! directory is changed to the section directory. A new menu $! is then displayed listing each document that is contained in $! the section. $! $! As the document menu is being created, SYSDOC also displays $! the first line of each document file on the menu. You should $! therefore make the first line of each document be the title $! for the document. $! $! When you select a document you are given the option to EDIT, $! TYPE, or PRINT the document. $! $! Pressing at any prompt will back you up to the $! previous level, or exit SYSDOC when pressed from the main menu $! $! $ on control_y then goto cleanup $! Constants $ formata = "!2UL - !15AS !50AS" $ formatb = "!2UL - !50AS" $ saved_dir = f$environment("default") $ def_queue="sys$print" $ do_redisplay = 5 $ no_redisplay = 3 $ @tasm$com:tasm_menusym ! Get common symbols $ wso:=write sys$output $ set defa TASM$DOC ! goto root directory $! Variables $ level = 0 ! Were at the top of dir tree $LOOP: $ GOSUB DISPLAY_SECTION ! Display what's there $ if $status .eq. do_redisplay then goto LOOP ! Refresh if necess. $ GOSUB DO_CHOICE ! Get user input $GOTO LOOP ! Repeat $! $DISPLAY_SECTION: $ wso CLS $ wso " O n l i n e S i t e G u i d e" $ wso " " $ COUNT = 0 $loop1: $ FILE=f$search("*.dir") ! look of .DIR files $ if (file .nes. "") $ then ! display them $ count = count + 1 $ item'count' = file ! save name in "array" $ name = f$parse(file,,,"NAME") $ lineout = f$fao(formatb,count,name) $ wso lineout ! disp. menu line $ goto LOOP1 $ else $ if (count .ne. 0) $ then ! displayed last .DIR, return $ count_tot = count $ count = 0 $ return no_redisplay $ else ! Were at the bottom of a section, get .DOCs $ count = 0 $ filesearch = "DOC*.*" $ LOOP2: $ file=f$search(filesearch) $ if (file .nes. "") $ then $ count = count + 1 $ item'count' = file $ name = f$parse(file,,,"TYPE") - "." $ open/read inp 'file' $ read inp line ! get title line $ close inp $ lineout = f$fao(formata,count,name,line) $ wso lineout ! display menu line $ GOTO LOOP2 $ else $ count_tot = count $ return no_redisplay $ endif $ endif $ endif $! $DO_CHOICE: $ wso " " $ inquire/nopun temp "Enter Choice #: " $ choice = f$integer(temp) $! $ if (choice .gt. count_tot .or. choice .lt. 0) ! Range check $ then $ wso "Invalid Choice" $ goto DO_CHOICE $ endif $! $ if (choice .eq. 0) ! a was entered $ then $ if (level .ne. 0) $ then $ set defa [-] $ level = level - 1 $ return do_redisplay $ else $ goto cleanup $ endif $ endif $! $! We have a valid choice $! $ file = item'choice' $ if (f$parse(file,,,"TYPE")) .eqs. ".DIR" $ then ! if a DIR selected then set default to it $ dir = f$parse(file,,,"NAME") $ set defa [.'dir'] $ level = level + 1 $ else !otherwise $GET_ACTION: $ wso "E - Edit" $ wso "T - Type" $ wso "P - Print" $ inq/nopun action "Action: " $ if action .eqs. "" then goto ACTION_DONE $ if (action .nes. "T") then goto CHECK_E $ type/page 'file' $ inq/nopun temp "< Press RETURN to continue >" $ goto ACTION_DONE $CHECK_E: $ if (action .nes. "E") then goto CHECK_P $ define/user sys$input sys$command $ edit 'file' $ goto ACTION_DONE $CHECK_P: $ if (action .nes. "P") then goto $ inquire/nopun new_queue "Queue: [''def_queue'] " $ if (new_queue .nes. "") $ then def_queue=new_queue $ else def_queue="SYS$PRINT" $ endif $ print/queue='def_queue' 'file' $ inq/nopun temp "< Press RETURN to continue >" $ACTION_DONE: $ endif $ return do_redisplay $! $CLEANUP: $ set defa 'saved_dir'