Author |
Message |
Antsabee
|
Posted: Thu Dec 22, 2005 9:16 pm Post subject: 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??? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: Thu Dec 22, 2005 10:58 pm Post subject: (No subject) |
|
|
code: | 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 |
|
|
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: Thu Dec 22, 2005 11:03 pm Post subject: (No subject) |
|
|
Dammit I forgot this:
Dir.Close (streamNumber)
stick it at the end |
|
|
|
|
![](images/spacer.gif) |
Mr. T
![](http://www.madpaintballer.com/images/purepwnage.gif)
|
Posted: Fri Dec 23, 2005 1:43 am Post subject: Alex's Opinion |
|
|
Still doesn't work. Says Dir.Get can't have parameters. |
|
|
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: Fri Dec 23, 2005 11:01 am Post subject: (No subject) |
|
|
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:
code: | 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)
|
|
|
|
|
|
![](images/spacer.gif) |
Antsabee
|
Posted: Fri Dec 23, 2005 4:28 pm Post subject: (No subject) |
|
|
but what exactly does this directory string look like?? and does the directory browser change to fit?? ![Question Question](http://compsci.ca/v3/images/smiles/icon_question.gif) |
|
|
|
|
![](images/spacer.gif) |
Antsabee
|
Posted: Fri Dec 23, 2005 4:33 pm Post subject: (No subject) |
|
|
OOO WOW allright the directory browser is a useless piece of garbage, thanks guys you were a big help!!! ![Very Happy Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
|