
-----------------------------------
Antsabee
Thu Dec 22, 2005 9:16 pm

I Need Desprate help with directories
-----------------------------------
I have a Problem Turing 3.1.1A
how do you set directories?, everytime 
I try I either crash the program or 
my computer  :? can someone show
 me a quick snipit of what opening a
 directory should look like or give me 
some tips on how it works???

-----------------------------------
do_pete
Thu Dec 22, 2005 10:58 pm


-----------------------------------
var streamNumber : int
var directory : string

put "Enter directory: " ..
get directory :*
streamNumber := Dir.Open (directory)

loop
        var fileName : string
        Dir.Get (streamNumber, fileName)
        exit when fileName = ""
        put fileName
end loop
This should work

-----------------------------------
do_pete
Thu Dec 22, 2005 11:03 pm


-----------------------------------
Dammit I forgot this:

Dir.Close (streamNumber)

stick it at the end

-----------------------------------
Mr. T
Fri Dec 23, 2005 1:43 am

Alex's Opinion
-----------------------------------
Still doesn't work. Says Dir.Get can't have parameters.

-----------------------------------
do_pete
Fri Dec 23, 2005 11:01 am


-----------------------------------
Oh that's right, sorry I got mixed up between Dir.Get and Dir.GetLong and I diddn't have turing at that moment. You should go like this:
var streamNumber : int
var directory : string

put "Enter directory: " ..
get directory : *
streamNumber := Dir.Open (directory)

loop
    var fileName : string
    fileName := Dir.Get (streamNumber)
    exit when fileName = ""
    put fileName
end loop

Dir.Close (streamNumber)


-----------------------------------
Antsabee
Fri Dec 23, 2005 4:28 pm


-----------------------------------
but what exactly does this directory string look like?? and does the directory browser change to fit?? :?:

-----------------------------------
Antsabee
Fri Dec 23, 2005 4:33 pm


-----------------------------------
OOO WOW allright the directory browser is a useless piece of garbage, thanks guys you were a big help!!!  :D
