Cast
 
Converts an expression to a specified data type

Syntax

Cast( datatype, expression )

Description

Converts expression to a datatype. Useful to be used in macros when datatype is unknown and also when converting to Type Alias.

Example

'' will print -128 because the integer literal will be converted to a signed byte
Print Cast( Byte, &h0080 )


Dialect Differences

  • Not available in the -lang qb dialect unless referenced with the alias __Cast.

Differences from QB

  • New to FreeBASIC

See also