Compiler Error XS0246

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Compiler Error XS0246

Post by Karl-Heinz »

The line:

iDiff := Integer ( ( ( iCurrentHeight ) - ( struTemp.bottom - struTemp.top ) ) / 2 )

causes the error XS0246 "The type or namespace 'iCurrentheight' could not be found" etc. The error is gone when i remove the iCurrenheight parentheses.

iDiff := Integer ( ( iCurrentHeight - ( struTemp.bottom - struTemp.top ) ) / 2 )

but why does throw the first line an XS0246 error ?

regards
Karl-Heinz
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Compiler Error XS0246

Post by robert »

Karl Heinz,

I think the compiler is confused and thinks that you are casting the value - ( struTemp.bottom - struTemp.top ) to the type iCurrentHeight.

In VO that could not happen because it does not know the

Code: Select all

(<TypeName>) <Expression>


cast.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply