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 / AGK ReadLine not working

Author
Message
GKCobra
13
Years of Service
User Offline
Joined: 4th Nov 2011
Location:
Posted: 12th Nov 2012 04:58
I have tried versions 1.76, 1.82, and 1.83, every time it try to compile the code I get the following error message:

Cannot perform 'integer' cast on type 'about_Fileptr' at line 19.



please help?
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 12th Nov 2012 08:47
ReadLine() returns a string. When you do this:


This creates an array of integers. So you're effectively trying to place strings into an array of integers and that's what's causing the error.

To fix this, just declare the array of strings:



Also be careful that increasing the variable index doesn't cause an out of bounds error.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Nov 2012 16:20
Also, it is a very bad idea to include spaces in file names ("about information.txt"). It works fine in Windows (and I hate that they set that precedent so many years ago). But doesn't work as well in other environments unless the name is properly quoted.

It is much easier to make sure that you use simple file names that will work in all environments, like "aboutinformation.txt" or "about_information.txt".

Cheers,
Ancient Lady
AGK Community Tester
GKCobra
13
Years of Service
User Offline
Joined: 4th Nov 2011
Location:
Posted: 12th Nov 2012 16:29
thanks,

changing the line from "arrText[100]" to "arrText[100] as string" fix the problem.

Login to post a reply

Server time is: 2024-11-24 01:18:59
Your offset time is: 2024-11-24 01:18:59