Make Xojo Datatype Strict?

  1. last week

    Dave S

    Oct 8 San Diego, California USA

    Is there any way to force Xojo to NOT use Implied Datatype casting?


    Dim i as Integer=5
    Dim d as double=i

    Currently (Implied) is valid.... Explict datatype would not

  2. Norman P

    Oct 8 Pre-Release Testers, Xojo Pro

    intrinsic types like integer double etc will always convert from one to the other where possible

    its not possible to turn on an error for a conversion like this
    at best you might get a warning

  3. Dave S

    Oct 8 San Diego, California USA

    didn't think so.

    I "assume" the compiler does it by inserting some "type conversion" call at the point a different datatype is required

    by that I mean (using my above example, which is of course very simplistic)
    the compiler actually internally produces something like ????

    Dim D as Double

    If so, would that mean that a program written to super strict datatyping, would be slightly smaller/faster (although probably not noticable)

  4. Norman P

    Oct 8 Pre-Release Testers, Xojo Pro

    at a very low level there is some conversion code but I dont know if thats done in the compiler and the IR that it generates or where

    as for whether it would be smaller or faster thats hard to say as a LOT of really low level stuff like this is done right in the chip itself so you would be measuring microinstruction speed
    you end up needing to read stuff like this

    enjoy :P

  5. Robin L

    Oct 9 Xojo Inc Europe (Germany, Rehlingen)

    Feedback Case #50245
    Feedback Case #54590

or Sign Up to reply!