Mintoris Forum

Author Topic: accessing files/directories in nested directories  (Read 330 times)

robotMeiker

  • Full Member
  • ***
  • Posts: 49
accessing files/directories in nested directories
« on: May 12, 2019, 08:39 PM »
This is a very simple fragment in my code to select a file/directory in "aDir" inside "myDir" which is in the root directory. I thought that I understood and had it right using the commnds; chDir() and Dir$() and
list d$(), but what am I doing wrong? Or is there another way to work
around this?


Rem Get a list of files and directories in this root directory.
d$() = Dir$()
list d$(), f$ 'select "myDir"

if isDir(f$) Then
chdir f$    'change to "myDir"
d$() = Dir$()
List d$(), f$ 'list contents of "myDir"
Endif         'select "aDir" in "myDir"

if isDir(f$) Then
chdir f$        'change to "aDir"
d$() = Dir$() << '‼RUNTIME ERROR:: "this is not a directory"
List d$(), f$   'select file to print
Endif

Print "FILE TO PRINT::  ";f$

…‥

Thanx in advance for a working solution.

Cesar

PS: I am using the latest version of mintorisBasic