×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Open Read Write Issues

Open Read Write Issues

Open Read Write Issues

(OP)
Okay this may seem trivial to most but I'm writing a program that will keep track of completed tasks and invintory but when i use the open command i can get it to create the file and input data but as soon as i goto run the program the second time it dosent add more data it replaces the old data with new. this program Primary reason is to keep track of where invintory is and what the technician will be paid for ve all the other job. i have all the other neccessary information i need but the data management. How do i keep an ongoing file of data for different sessions of the program?

RE: Open Read Write Issues

When writing, open the file in mode APPEND, e.g.

OPEN "INVENTORY.TXT" FOR APPEND AS #1

RE: Open Read Write Issues

The Append assumes you always want to add (only) never update or delete anything.

If you want the latter, you should open your file as input and open another file for output. When finished. close and then kill the original and rename the work file.

RE: Open Read Write Issues

I haven't done anything in Qbasic but would suspect that inventory tracking would be better handled with a random file type if it is available. And possibly as a linked list type file with pointers to individual records so you can add, delete, and modify easily.

Ed Fair
Give the wrong symptoms, get the wrong solutions.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close