Casting
Xojo Version 2021 r3.1
Description
Casting or Conversion is a way of changing an item from one data type to another. When we assign information to a variable we have to make sure that the information and the variable are both of the same data type. There are two main functions that we use for conversion in Xojo.
Convert to an Integer with the Val() Function
We use the Val() function here. Whatever we pass into the parenthesis of the Val() function will be converted from it's original data type to an Integer.
Val(txtItem.text)
Convert to a String with the Str() Function
We use the Str() function here. Whatever we pass into the parenthesis of the Str() function will be converted from it's original data type to a String.
Str(itemSKU)