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.

AppGameKit Classic Chat / Programm crushes... am i doing something wrong???

Author
Message
Compozitor
13
Years of Service
User Offline
Joined: 6th Sep 2011
Location:
Posted: 20th Sep 2011 15:24
Hello! I'm very new to AppGameKit and to programming, so please don't be too hard on me

Here is my code. I write a Menu Function, for easy creation of them. And right now there is my rock... working with files. This is a test.

It compiles good. But when i try to run it... it's crushing.
Help please. Is there some big mistake?
Thenks!

Here is the main code:


And here is my test.txt:
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 20th Sep 2011 17:45 Edited at: 20th Sep 2011 17:47
I believe that you cannot read an integer or a string from a text file that you've created. Those must have been written by AppGameKit, and AppGameKit writes them in its own format.

To read in lines from a text file, use ReadLine(1) instead. That will read in each line as a string, and you can convert the string into an integer using Val(). Note that there is a bug with Val() where it only converts to integer, so you cannot use this technique with floats.

To use floats, you would need to switch back to ReadFloat(), but you would also need to have written the data into the file using AGK's notation.

Compozitor
13
Years of Service
User Offline
Joined: 6th Sep 2011
Location:
Posted: 20th Sep 2011 18:51
Thanks for the answer! It helped. And other thing i finally realised what i did wrong in the code. )

Login to post a reply

Server time is: 2024-11-22 04:19:41
Your offset time is: 2024-11-22 04:19:41