Converting data types (Casting)

Converting value from one data type to another is known as casting in SeqZap.

Some data types are directly convertible between one type and another, for instance, you can assign a decimal variable an integer value such as 42 without any problems. SeqZap allows you to do this conversion directly because no information is lost when concerting an integer to a decimal value.

Converting the other way, assigning an integer variable a value such as 3.14 is not allowed directly because SeqZap does not want you to accidentally lose any information. So to convert a decimal value to an integer you have to use a casting function.

Most casting function are called the same as the data type which you want to convert to, for instance, to convert a decimal value to an integer you would use the integer(decimal) function.