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 / Cant Display Text from Second Text File after Displaying First Text File

Author
Message
Darknaruto
9
Years of Service
User Offline
Joined: 24th Aug 2015
Location:
Posted: 31st Aug 2015 02:47
After displaying the text from First Text file, it wont display the text from Second Text file, instead, it display first text file again.

Here is the code

char* cFilePath[2]
{
"Chapter2.txt",
"myFile2.txt"

};

agk:penToRead(41, cFilePath[m_iSetFileNo]);

for (int i = 0; i < 30; i++)
{
m_sReadTextLine[i] = agk::ReadLine(41);

agk::CreateText(i, m_sReadTextLine[i].c_str());
agk::SetTextSize(i, 50);

SetTextPosition();

}

The m_iSetFileNo is being added after it display finish the text in First Text file.
How should I display the text from second Text file?

I am who I am
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Aug 2015 18:19 Edited at: 31st Aug 2015 18:24
hmm,
try Log ( szMessage ) or print some information at screen.
i would say it should recycle the text.
maybe the second file it not found and nothing is overwritten?
check case sensitive if problem is at android.
try GetFileExists ( szFile )

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Darknaruto
9
Years of Service
User Offline
Joined: 24th Aug 2015
Location:
Posted: 31st Aug 2015 18:34
I have tried it and it found the second text file. So what seems to be the problem?

I am who I am
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Aug 2015 18:54
hm,
maybe log / print m_sReadTextLine
have the other file different line breaks?

AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Darknaruto
9
Years of Service
User Offline
Joined: 24th Aug 2015
Location:
Posted: 31st Aug 2015 20:33
I found out what is the problem, it appears that after I created the ID for the text, I forgot to delete the ID first before I create next text. It would appear that the text from the same ID cant be replace and must be delete and create again.

I am who I am
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Aug 2015 20:43
hmm, then it should response a error already used.
i would also expect it used the id and overwrite the text.

u can also use SetTextString

Quote: "
GetErrorOccurred ()
GetLastError ()
SetErrorMode ( mode )
"


AGK (Steam) V2 Beta .. : Windows 10 Pro, 8.1 Pro 64 Bit : AMD (15.7.1) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-16 20:22:17
Your offset time is: 2024-11-16 20:22:17