Type conversion

[ Back ]

There's no coercion in NaaLaa. Therefor every line in:

a = 5.0
b# = 5 + "4"
c$ = 57 - 32.0

would generate an error. You convert a float or string expression to an integer with int(expr), to float with float#(expr) and to string with str$(expr). Ex:

a = int(5.0)
b# = float#(5) + float#("4")
c$ = str$(57 - int(32.0))

Sub routines

function int(float_expr#)
function int(string_expr$)
function float#(int_expr)
function float#(string_expr$)
function str$(int_expr)
function str$(float_expr#)

function int(float_expr#)

Convert float_expr to an integer value.

function int(string_expr$)

Convert string_expr to an integer value.

function float#(int_expr)

Convert int_expr to a floating point value.

function float#(string_expr$)

Convert string_expr to a floating point value.

function str$(int_expr)

Convert int_expr to a string.

function str$(float_expr#)

Convert float_expr to a string.

[ Back ]