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 AppGameKit Corner / Unable to read correct data from any .txt files

Author
Message
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 10th Nov 2015 18:30
Hey guys, I have another issue coming this time from any data from the .txt files.

My code is :


Notice that the file called "myfile.txt" the only thing stored is : " 10 " ( without quotes ) on the first row
When i run the program the number i receive is : " 12337 " ... ?! where is this coming from?

After this i want to make another code to write in files some controls / data

Where is the problems this time ?


Thank you for your time,
Alex
Mike Archer
9
Years of Service
User Offline
Joined: 19th Feb 2015
Location: Wales
Posted: 11th Nov 2015 17:48
ReadInteger() and ReadFloat() don't read text and convert it to a number, they read the bytes of data straight out of the file. You need to use ReadString() and then convert it to a number.
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 12th Nov 2015 08:21
Perfect thank you for your time .

The code is :

Login to post a reply

Server time is: 2024-11-23 11:30:39
Your offset time is: 2024-11-23 11:30:39