Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / programming help needed

Author
Message
mysticone
17
Years of Service
User Offline
Joined: 4th Sep 2007
Location:
Posted: 5th Sep 2007 05:16
The code:
[1] open to write 1,"g:\db_projects\user_access.fad"
[2] write string 1,"A"
[3] close file 1
===========================
I am trying to write the string text "A" to my file on the hard drive [G to the folder \db_projects to the file \user_access.fad
===========================
I do not know what I am doing wrong
The letter "A" just will not write to my file , the file remains blank - I can not get any string data to write to a file - H E L P , Please - Thank You
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 5th Sep 2007 06:14
Try this.

mysticone
17
Years of Service
User Offline
Joined: 4th Sep 2007
Location:
Posted: 6th Sep 2007 23:05
Alright - problem solved , Thanks for the lesson pcRadier , The problem is that DB will only acknowledge a text file with the .txt extension. I used .fad (F)ile (A)ccess (D)ata . oh well , .txt it is
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 7th Sep 2007 17:44 Edited at: 7th Sep 2007 17:58
You did problem solving.
Because understanding is wrong, I explain it.

You, open and write
my, delete and write

When a file exists, "write" does not process it.
Therefore I deleted a file first.



A file name, "user_access.fad " is good.
I changed it so that I tested it.
I simplified it to do problem solving.
Therefore you were confused.
I am sorry.
mysticone
17
Years of Service
User Offline
Joined: 4th Sep 2007
Location:
Posted: 8th Sep 2007 15:11
Yes , I believe I understand now. If the file already exists , the write command will fail , so to write data to a file , the file can not exist. [ so ] am I correct in assuming that if I want to update data in a file that already exists , I must first read ALL that existing data into my program , assign ALL that data into varriables to store it , update the stored data I want with the new data , then delete the existing file , THEN , write ALL the data back into a new the file. (if this is correct - DANG - HOW ASININE) - if not , what is the correct way of storing and retrieving data from a file that already exists. DB Pro's Help guide to me was poorly laid out and the examples they give suck. click on an example link and it takes you to a BIG O file where you have to search for the example. Maybe I am just so into the way Q Basic worked that I need to throw out that knowledge. DB Pro has its similarities but I am now re-learning how to write basic programming "the DB way". For all you DB programmers , dont get mad . I REALLY REALLY LIKE DB PRO , REALLY I DO !! Its capabilities seem endless - ONCE you learn it. Its just when I first learned of DB, people talked like it was so easy to learn and do. And I saw all that they were creating - WOW. Now that I have the DB Pro software - IT AINT SO EASY. I noticed that there are (2) volumes on the use of DB Pro, where do I need to go to get both volumes please - Thank you
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 10th Sep 2007 06:19 Edited at: 10th Sep 2007 06:33
This tutorial may help you.
"The Basics of DBPro Tutorial"
http://forum.thegamecreators.com/?m=forum_view&t=25076&b=7

good luck
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK

Login to post a reply

Server time is: 2024-09-27 05:16:57
Your offset time is: 2024-09-27 05:16:57