Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing Variables into a Text File

Status
Not open for further replies.

Peddlerty

IS-IT--Management
Feb 11, 2003
6
GB
Hi,

I am trying to store 3 variables (partNumber, numOfParts, partPrice) into a text file. Right now, I can get them into a file but cannot figure out how to list them on seperate lines. Ex:

partNumber
numOfParts
partPrice

I also need the function to go the the last line of the text file before storing the next 3 Variables ... so I can create a Part list that I will later read from. I have to make sure no lines with text are overwritten.

Does anyone have any advice? Or are there any examples out there that are similar to this?

Thanks
-Tim

 
If you are using the fputs command and have opened the file with the TEXT flag, then the contents of each fputs command will be placed on a separate line.

To add your lines to the end of the file, open the file with either the APPEND or READAPPEND flag (APPEND only lets you append to the file, while READAPPEND appends all writes to the end of the file but you can still read data from the file if necessary).
aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top