Reading and Writing Files

Non-platform specific questions.

Reading and Writing Files

Postby jazz_e_bob » Wed Jan 21, 2004 3:33 pm

Script for writing text to a File:

FILE *fp;
fp = fopen("mytext.txt", "w");
fprintf(fp, "Insert Text Here");
fclose(fp);

http://class.et.byu.edu/ce594-2-win03/L ... esson.html
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby Just4Fun » Wed Jan 21, 2004 6:09 pm

jazz_e_bob,
How would this be used with a GE actor? TIA
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby jazz_e_bob » Wed Jan 21, 2004 10:06 pm

I tested it by using Mouse Button Down event on an actor.

Mouse Button Down calls the script.

The script writes the file.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Wed Mar 02, 2005 5:12 pm

And where do YOU write the file ?
( OK I'm one year late :) )
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Wed Mar 02, 2005 9:04 pm

:D

I don't use this code since the load/save vars functions were introduced.

But I do know that older versions of GE save their var files in the GE folder.

When compiled, the var files end up in the same folder as the executable.

http://game-editor.com/forum/viewtopic.php?t=586&highlight=save+vars
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest