Comment ============================================================= DM3DIR.MNU Copyright 1990 by Marc Perkel This example brings up all directories under the current directory and allows you to change to that directory. This example was written to work under DM3 but can be run from the command line by typing MARXMENU DM3DIR. It requires that you have PIPEDIR from the Computer Tyme DOS ToolBox, or a PIPEDIR type program that can scan your drive and output complete file names that can be redirected to a temporary file. ============================================================= EndComment Var ChooseFiles NewPath TmpFile W BoxDim ClearScreenOnExit Off ClearScreenFirst Off BoxBorderColor Green Brown BoxInsideColor Yellow Brown BoxHeaderColor Yellow Mag DrawBox 31,9,17,3 Write ' * Scanning * ' ;Run PIPEDIR and redirect the output to a temporary file, then ;read the output file into a string array and delete the file. TmpFile = UniqueFileName Execute 'PIPEDIR/T/N/X>' + TmpFile ReadTextFile TmpFile ChooseFiles DelFile TmpFile EraseTopWindow if NumberOfElements(ChooseFiles) = 0 then ExitMenu ;------ this calculates the size and position of the pick window. BoxDim[3] = Min(LongestLine + 6,ScreenWidth - 6) BoxDim[4] = Min(NumberOfElements(ChooseFiles) + 2,ScreenHeight) BoxDim[1] = Max(Min(50,ScreenWidth - BoxDim[3]),1) BoxDim[2] = Max(Min(7,ScreenHeight - BoxDim[4]),1) DrawBox BoxDim[1] BoxDim[2] BoxDim[3] BoxDim[4] NewPath = PickOne ChooseFiles if NewPath = '' then ExitMenu ;------ Here we remove the file name from the path. ChDir NewPath