Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I Need Desprate help with directories
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Antsabee




PostPosted: 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 Confused can someone show
me a quick snipit of what opening a
directory should look like or give me
some tips on how it works???
Sponsor
Sponsor
Sponsor
sponsor
do_pete




PostPosted: 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
do_pete




PostPosted: Thu Dec 22, 2005 11:03 pm   Post subject: (No subject)

Dammit I forgot this:

Dir.Close (streamNumber)

stick it at the end
Mr. T




PostPosted: Fri Dec 23, 2005 1:43 am   Post subject: Alex's Opinion

Still doesn't work. Says Dir.Get can't have parameters.
do_pete




PostPosted: 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)
Antsabee




PostPosted: 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
Antsabee




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: