I'm debugging my app. Here's a question.
When I press a button, I get something done on a data table, which I pull\construct in a separate function:
pressButton=Function({this},
myTable = getMyTableFunction(input1, input2);
//Do Stuff with myTable
);Function getMyTableFunction returns a reference to a datatable that was pulled and handled inside the function. But sometimes data pull does not produce any results. For this case I just have a simple if that, when table has data, manipulates it and returns table reference, otherwise opens a modal window that says no data was pulled and that's it.
What happens: myTable is not defined then (function does not return anything). And when I proceed doing stuff with table I get errors.
What I want: Understand what I should put in if statement for return. Some like return(Empty Table) or something.
So that when myTable = GetMyTableFunction() is evaluated, I can check myTable and refuse to try to do any manipulations with it.
Thanks!
You can always use a Try() function like:
If( Try( myTable << Get Name, "No Table Returned" ) != "No Table Returned",
....
)