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 / Writing to File - Help Please

Author
Message
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 15th Jun 2009 22:46 Edited at: 15th Jun 2009 22:47
I created this code becuase my dad and I play Fifa 09 alot on my xbox 360. It stores all of our financial records and hopefully our signings. However I cannot figure out where to add the Write and Read commands. Will someone please point my in the right direction?

Here is my code:



Thanks Alot. Jack

TheCleverGuyz
Serial Velocity
16
Years of Service
User Offline
Joined: 24th Aug 2008
Location:
Posted: 16th Jun 2009 17:07 Edited at: 16th Jun 2009 17:09
You seem to be resetting your variables after loading them.

Try replacing this:



With this:



Also, when you read or write to the file, make sure the file number is always 1; not 1, 2, 3 and 4

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 16th Jun 2009 17:21
Once you open / close a file, you always use the same file number to access it. i.e. open to read 1,"Variable.JKV" should always refer to file #1, because that is the number assigned to it. Also, as a good general practice, you should verify a file exists before you try to load it, otherwise the program will error if it is not there.

I would suggest you look at using SELECT and ENDSELECT with the CASE and ENDCASE commands instead of using the dreaded goto.

Here is a slightly revised version of your code:



So many games to code......so little time.
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 16th Jun 2009 18:25 Edited at: 16th Jun 2009 18:50
[EDIT} Is there a way to clear text only from the screen?

Thanks very much guys. It didn't occur to me to use the EXIST command. I am looking into CASE commands now as my uncle studied BASIC Language at UNI he is giving me a few tips.


Thanks again.
Jack

TheCleverGuyz
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 16th Jun 2009 22:03
i think you can use CLS command, but it delets the whole screen

Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 16th Jun 2009 22:12
I know about the CLS command but that doesn't jsut delete text.

TheCleverGuyz
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 16th Jun 2009 23:53
well if you call set cursor 0,0 every loop before you are gonna print it prints nicely over the old texts, but im not sure if it works very good, sometimes when you have high framerates it gets printedmultiple times so you just get a white stripe instead of text

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th Jun 2009 09:18 Edited at: 17th Jun 2009 09:19
Quote: "Is there a way to clear text only from the screen?"


Not a single command but you can mimic it in several different ways.

1. If your text is going to be in specific areas and graphics aren't going to be under where the text is you can use the command SET TEXT OPAQUE and any text you put on the screen will overwrite any graphics or other text because it (after that command) writes the background color to the screen also.




2. You can just grab the entire screen with GET IMAGE and PASTE IMAGE every time you wish to clear the text.




3. You can make all text sprites so they don't interfere with the background.



I'm sure there are other methods but I couldn't think of anymore.

Login to post a reply

Server time is: 2024-11-24 05:43:55
Your offset time is: 2024-11-24 05:43:55