PROGRAM win1_3 {filename is 'win1.3'} @ HI_BUF @ NOLINE INCLUDE "Mouse.Aliases" {this is a dependency for the Window Globals/Procs include files} INCLUDE "Window.DIMs" INCLUDE "Window.Globals" INCLUDE "Window.Procs" {====================================MAIN======================================} onerr goto error_trap gosub menu END { Program execution ends here } {The 'end' command is in the 'quit' routine} {============================ROUTINE DEFINITIONS===============================} { All routines MUST be placed AFTER the main program section of code } INCLUDE "Window.routines" {====================================MENU======================================} routine menu home print htab(17) print "View online Volumes,Catalog a volume or Quit? V/C/Q: " get a$ home a%=asc(a$) case_of a% do "V","v" gosub online enddo do "C","c" gosub get_path gosub catalog enddo do "Q","q" gosub quit enddo else_do gosub menu endcase return {==================================GET_PATH====================================} routine get_path gosub add_window["Main Window",5,13,19,66] {Instantiate a simple window} print "Please enter the full path to folder to be cataloged: " print {Insert a blank line} htab(14):vtab(7) {place cursor 'in' the 'window'} input "]";p$ {display prompt and store path to p$ variable} return {===================================CATALOG====================================} routine catalog prefix p$ {Set default prefix to contents of p$} repeat {Catalog the contents of default prefix} string$=cat$ if peek(48881)=0 then begin {a 0 in memloc 48881 means that there ARE} print string$ {entries to display via the 'cat' command} endif until peek(48881) <> 0 {a non-zero in memloc 48881 means that there} {are NO entries left to display} print "Press any key to continue" get a$ {Pause to view catalog} prefix "/hd1/mab/dtcs.tests" gosub pop_window gosub menu return {====================================ONLINE====================================} routine online gosub add_window["Online Window",5,13,19,66] home online_name$=online$ print online_name$ print "Press any key to return to menu" get a$ {Pause to read the 'Press any key...' msg} gosub pop_window gosub menu return {====================================QUIT======================================} routine quit home print print "Quit program? Y/N: " get a$ a%=asc(a$) case_of a% do "Y","y" prefix "/hd1/mab/dtcs.tests" {Reset default prefix on exit} home {Clear the screen} end {Quit to MAB 'shell'} enddo do "N","n" gosub menu enddo endcase return {==================================ERROR_TRAP==================================} routine error_trap home {poke 48861,0} if peek(48856)>0 then begin print "Language error # ";peek(48856); else begin print "ProDOS error # ";peek(48857); endif print " in line ";peek(48882)+256*peek(48883) get a$ gosub pop_window end