Computer Science Canada

Output to text file

Author:  Warchamp7 [ Fri Sep 21, 2007 11:06 am ]
Post subject:  Output to text file

Is there any simple way to make a turing program output only particular blocks of text to the screen and a specifiable .txt file?

I just have a generator program that it asks for certain values, then generates multiple lines of text based on the values given.

Is there an easy way to make this happen without the use of the 'Run With Args' dialog??

Thanks,
Warchamp Cool

Author:  Mazer [ Fri Sep 21, 2007 11:11 am ]
Post subject:  RE:Output to text file

I'm not entirely sure what you mean. Have you tried reading a File I/O tutorial?

Author:  Warchamp7 [ Fri Sep 21, 2007 11:15 am ]
Post subject:  RE:Output to text file

Okay, I have my program and it asks like 4-5 questions to the user for particular numbers

After all the data needed is input, it generates lines of code based on those numbers.

I'm looking for a way so that after the data is input, have it like pop up a dialogue asking for destination and file name etc. Then outputting the lines of code to said file

Author:  Dan [ Fri Sep 21, 2007 11:45 am ]
Post subject:  RE:Output to text file

The 'Run With Args' dialog is not ment to be used for noraml file i/o. This is a local seting and it will not change where the output goses on any once eltes computer who is runing your program.

You should be using the methods turing provieds for doing file I/O.

Here are some tutorals on it:

http://compsci.ca/v3/viewtopic.php?t=12972

http://compsci.ca/v3/viewtopic.php?t=5

http://compsci.ca/v3/viewtopic.php?t=6818



P.S. To open a new window or use dialogs you will need to look in to the window comand and/or the GUI modual. This is not realy needed for what you whont to do tho.

Author:  Warchamp7 [ Fri Sep 21, 2007 12:00 pm ]
Post subject:  RE:Output to text file

First link gave me what I needed. Thank you


: