
/* This file will allow users of the ATARI CDAR504 to download and list
   files on any CD_ROM you have in the drive. Make an option in MAIN.M to
   call this file. 
    
   From STaTus BBS, the AUA Support BBS in Auckland New Zealand            /*
 
p$ = "P:\\";
print("\nRom library\n");
print("Direct access to whatever CD ROM is currently online\n");
while(1)
{
        c$ = "dir ";
        strcat(c$,p$);
        sysopshell(c$);
        print("\n[M]ain menu, [P]revious dir, [N]ext dir, [X]fer. \n");
        k = key_match("MNPX?");
        if(k == 'M')
            return;
        else if(k == 'N')
        {
            print("Enter next directory.\n");
            input(p$,s$,9);
            if(len(s$) > 0)
            {
                  strcat(p$,s$);
            }
        }
        else if(k == 'P')
        {
            right(r$,p$,1);
            if(strcmp(r$,"\\") == 0)
                  left(p$,p$,len(p$)-1);
            while(len(p$) > 3)
            {
                  right(r$,p$,1);
                  if(strcmp(r$,"\\") != 0)
                        left(p$,p$,len(p$)-1);
                  else  
                        break;
            }
        }   
        else if(k == 'X')
        {
            input("Enter filename in this directory to download. ",s$,12);
            c$ = p$;
            strcat(c$,s$);
            print(c$);
            download(c$);
        }
        else if(k == '?')
        {
            list("\\bbs\\rom.txt");
            print("\n\nOptions available in the STaTus CD ROM library\n");
            print("  [M]ain menu  - return to STaTus main menu\n");
            print("  [N]ext dir   - enter the name of the next subdirectory (with trailing \\)\n");
            print("  [P]revious directory - step out one level of subdirectory\n");
            print("  [X]fer       - enter the filename (no path required) you want to download\n\n");
        }
}
