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

Username:   Password: 
 RegisterRegister   
 Find a file?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
paintball_guy




PostPosted: Wed May 07, 2003 2:21 pm   Post subject: Find a file?

Hey, I wanna make a program that finds a random file on your computer and then goes "POOF! I know everything about your computer mwuahahaahahah" anyway i can do the poof part but how do i get the program to just find a random file, because if i preset which file to find, then it may not always be there.... PLEH<< (thats help backwards Smile)
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Wed May 07, 2003 3:44 pm   Post subject: (No subject)

this code might help u
code:
var streamNumber : int
var fileName : string

streamNumber := Dir.Open ("c:/")
assert streamNumber > 0
loop
    fileName := Dir.Get (streamNumber)
    exit when fileName = ""
    put fileName
end loop
Dir.Close (streamNumber)
paintball_guy




PostPosted: Wed May 07, 2003 8:34 pm   Post subject: Thx for script

tx for script but it says "Assert condition is false" Sad
Homer_simpson




PostPosted: Wed May 07, 2003 9:23 pm   Post subject: (No subject)

well simply replace that with
code:
if streamNumber > 0  then put "directory not available"
end if
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  [ 4 Posts ]
Jump to:   


Style:  
Search: