Each function has its own specification that tells you how it can be used. The specification includes a description of what it does, the number of parameters it takes, the type of data that can be used to each parameter and the type of data returned by the function. There are 6 basic data types:
A data item is a field or record in your family tree file. It is what a data reference refers to.
If you are passing a function as a parameter to another function you must be sure that the type of data the the first function returns matches the type of data expected as a parameter by the second function. The match does not necessarily have to be exact. If a function expects to receive a data item as its first parameter you can pass it a function that returns a record - because a record is a kind of data item (both records and fields are data items).
The list of data types given above is not quite complete. The LastUpdated function, for example, returns a special kind of date that also includes the time. However, for most purposes, this can be treated simply as a date. The Field function takes a Data Reference Constant as first parameter - which is different from any of the data types listed above. Many functions take parameters which specify a particular kind of data item - such as a record - or even, more specifically, a particular kind of record, such as an Individual record. However, with these minor qualifications, the list of data types above includes all the data types you will need when using functions.
Data references and prompts can also be passed as parameters to functions, and these do not include a specification of their data type - but these are usually determined by context. If a function takes a date parameter and you specify a data reference to a data item that is in fact a date, it will be treated as a date. If you passed the same data reference to a function that expected a text expression, the same data item would be treated as a text expression. Very occasionally (e.g. if you combine data references using operators) there may be ambiguity about the data type, in which case you can use a Type-Specifier Function to remove the ambiguity.
You can pass text and data items as boolean parameters. A text string is deemed to be false if is empty (has no text), and true if not. So the text strings "0", "False" and "No" all count as True because these strings are not empty. A data item is deemed to be True if it is a flag or event data item. That is to say, if a flag or event data item exists at all, it evaluates as True. All other data items evaluate as True if and only if they are not empty. If they are empty (e.g. an empty string value or a date with no value), they evaluate as False.