Variant Records used as a return type from search functions
When searching for a value in an array a programmer is faced with two possibilities. 1. The value searched for is found and the index of the value in the array is returned. 2. The value is not found and no array index is returned. It is common practice to return a scalar value from functions using the C programming language. This tradition goes back to the earliest days of the C language when unspecified function return types were given the int type by default by the compiler. The C language does not have a concept of exceptions or exception handlers. Instead, the value returned by a function either indicates success or failure. It is common for positive return values to indicate success and negative or zero values to indicate failure. This pattern was established by the Unix operating system. C was invented to write the Unix operating system. A search function is often designed to return the ind...