Menu

Data Conversion

 
In order to transfer data from a feature output to a feature input, a connection must first be established.  For a connection to a data input, the reciprocal output data type must be compatible.
                
Absyntax supports several ways of converting data from one type into another and it will hide any inherent complexity from you.  In general, though, the chance of any given data type being convertible to any other type are low.  This is because there is a potentially unlimited number of data types that we might define.  What do a tree and a tennis ball have in common, and how might we convert from one to another?  This depends on how these types have been defined and what, if any, conversion methods have been made available to Absyntax behind the scenes.  The good news is that you do not need to know these details.  Absyntax will only allow you to create connections that make sense.
 
Revisiting the previous example concerning cars and hair dryers, we established that both are types of powered item.  So whenever we have a car we also (implicitly) have a powered item.  This means that a "Car" output could be connected to a "PoweredItem" input.  But when we consider this in reverse, it is not possible to say that if we have a powered item it must be a car: it could be a hair dryer.  This means that a "PoweredItem" output could not, in general, be connected to a "Car" input.
 
There is a middle ground.  By way of example, consider "46".  You have probably assumed that this is a number.  But in the context of this document, "46" is no different to any of the other text you are reading.  Importantly, your computer does not store it as a number and so cannot do number-related things with it (like add it to another number).
 
It is sometimes the case that data of one type can be converted to data of another type as long as it is in the right format.  In the case of text data, "46" can be converted to the number 46 whereas "46a" cannot.  Absyntax cannot know in advance whether an item of text will be in a format that is suitable for conversion to a number, but it can optionally allow you to create connections requiring these kinds of conversion.  It does so on the understanding that you know what you're doing and accept that the transmission of data from output to input is not guaranteed because the conversion may fail.