Pop quiz!
Question 1
Suppose you have a function GetCurrentValue which gets the current value of user certain interface objects, and returns missing (.) for others. Suppose you have a list of interface objects (AllInterfaceObjects).
Will this work?
UserValues = Transform Each({object}, AllInterfaceObjects, GetCurrentValue(object));
FilteredValues = Filter Each({value}, UserValues, !Is Missing(value));Answer:
View more... Question 2
As you may or may not know, Create Database Connection is a function for creating database connections. It returns a database connection on success, and missing on failure.
Does this work?
connection = Create Database Connection(magicString);
if( !Is Missing(connection),
RunSomeQuery(connection),
Print("I have failed to connect")
);Answer:
View more...Nope. Is Missing returns an error, complaining that it expects numeric values.
Nope. Is Missing returns an error, complaining that it expects numeric values.
My Proposal
Make the use of missing (.) and Is Missing more disciplined.
- Do not magically thread the function through lists, tell me if the variable holding the list is missing or not.
- If Is Missing cannot handle your success, do not use missing to signal failure.