April 30, 2024, 07:50:03 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Places where automatic typecast in dereferencing doesn't work

Started by Parker, December 12, 2005, 08:27:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Parker

I've noticed a few places where I've declared something as string * or int * or a pointer to a UDT type, and when I try to use *variable, it gives me an error. When I put *(string)variable it works though.

Anyways, these lines required the fix:
if (instr(*(string)m_pFile, "<%") = 0)
ch = *(Lexer)this.*(string)m_pFile[m_uPos];
// m_pFile is declared as the following:
// string *m_pFile;
// This line works fine:
Read(file, *m_pFile, GetFileLength(file));

If you need more to reproduce the error I can post the subroutines where the errors occurred.

Ionic Wind Support Team

Ionic Wind Support Team

Parker

I've found another one, which may have been brought on by the addition of the -> operator:
*ptr = mid$(ld->*pText, start+1, (ld->uPos-start)-1);
If I write *(string)pText it works. The error message given is "no appropriate conversion exists"