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

Username:   Password: 
 RegisterRegister   
 Need help with my program...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Delta




PostPosted: Tue Mar 09, 2004 11:02 am   Post subject: Need help with my program...

Ok...for some reason ... not known to me my program ceases to work
so0o0o I come toyou... (cough) I need help :S
anywho... if you get an error when you run it... thats the problem lol
fools (j/k) so ya....

note : H drive is for school you might wanna change that to whatever you've got at your computer... example fileName := "C:\\Fill up\\a_"

code:
Dir.Create ("H:\\Fill up") % Create a new directory on the H: drive

var fileName : string := "H:\\Fill up\\a_" % Set File to save to
var myStream : array 1 .. 5 of int % Streams for each process called
process FillUp (file : string, cnt:int) % params are fileName and counter(for array)
    const myFile : string := file % Starter file name (stored for easy access)
    var tempFile : string % temperary filename
    var counter : int := 1 % counter (add to end of filename so files don't overlap)
    loop
        tempFile := myFile + intstr(counter) + ".txt" % Set the new filename
        open : myStream(cnt), tempFile, put % Open the file
        for i : 1 .. 100
            put : myStream(cnt), "This is my stream" % put this in the file 100 times
        end for
        close (myStream(cnt)) % Close the file
        counter := counter + 1 % Add to the counter value
    end loop
end FillUp

fork FillUp (fileName,1) % Call the first process
fileName := "H:\\Fill up\\b_" % Change the filename for the second process
fork FillUp (fileName,2) % Call the second process
fileName := "H:\\Fill up\\c_" % Change the filename for the third process
fork FillUp (fileName,3) % Call the third process
fileName := "H:\\Fill up\\d_" % Change the filename for the fourth process
fork FillUp (fileName,4) % Call the fourth process
fileName := "H:\\Fill up\\e_" % Change the filename for the fifth process
fork FillUp (fileName,5) % Call the fifth process


so ya... thats the program... if it runs... then plz private msg the code to me or just post it (bits Smile )

well thnx for your help once you do it... if you can :S.... good luck to ya'll lol texan style lol
Sponsor
Sponsor
Sponsor
sponsor
recneps




PostPosted: Tue Mar 09, 2004 3:58 pm   Post subject: (No subject)

Looks fine to me, what specifically is the problem? (i would run it but i dont like endless text files on my comp ;D its slow enough as it is.
Tony




PostPosted: Tue Mar 09, 2004 5:08 pm   Post subject: (No subject)

Delta - you're being a jerk Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
shorthair




PostPosted: Tue Mar 09, 2004 5:26 pm   Post subject: (No subject)

Well you know that ociety is coming to an end when not evn mods can name threads proerly , i mean come on delta you should know better
tisk tisk tisk Crying or Very sad
jonos




PostPosted: Tue Mar 09, 2004 8:27 pm   Post subject: (No subject)

your code looks perfect, i spent 10 mins looking at it and trying to figure it out, but i couldn't find anything wrong with it. nice code though, most originial piece of code i have yet seen.

hehehe
Tony




PostPosted: Tue Mar 09, 2004 10:38 pm   Post subject: (No subject)

don't really need that in processes though... processes tend to screw up and in fact slow down the execution
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
jonos




PostPosted: Tue Mar 09, 2004 10:39 pm   Post subject: (No subject)

just put them in a looop to make tony happy then Wink
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: