CellIsUpdateable
Posted: Tue May 21, 2013 8:29 am
Admin Edit: Split from this thread since it's more in the nature of a general query than an enhancement request.
Hi Alan,
Your reply for CellsUpdateable is intersting. Now I met the same problem here:
ElseIf ( l_Writeable = 0);
# Bang user on head with frying pan and tell them to stop trying to write to consolidations or rules elements, or whatever
My l_Writeable is 0. But I really need to write the value to such "consolidations or rules elements". In my case, it might be "rules elements". How should I do? Is there a way to break the rules for these cells, after the write value to them, build the rules to them again?
Thanks.
LP_user
Hi Alan,
Your reply for CellsUpdateable is intersting. Now I met the same problem here:
ElseIf ( l_Writeable = 0);
# Bang user on head with frying pan and tell them to stop trying to write to consolidations or rules elements, or whatever
My l_Writeable is 0. But I really need to write the value to such "consolidations or rules elements". In my case, it might be "rules elements". How should I do? Is there a way to break the rules for these cells, after the write value to them, build the rules to them again?
Thanks.
LP_user
Alan Kirk wrote:I doez disagree on this one. My belief is that a function return value should always have a specific and unambiguous meaning. Consequently I'd rather that if the element doesn't exist, it returns -1 rather than 0. The test for whether the cell is writeable can still be expressed asSteve Vincent wrote:This could have been made twice as useful as it is had someone thought about it more...
CellIsUpdateable checks if a cell can be written to, but it FAILS if one of the elements doesn't exist. Rather than failing (and dumping things in to the error log) it should also return zero if the element is missing,
or alternativelyCode: Select all
if (CellIsUpdateable(Blah)=1);
so no changes to exisitng code would be needed, but if it returned -1 for a missing element then you'd have the option of using an If/Elseif block and save a little code and a few processing cycles:Code: Select all
if (CellIsUpdateable(Blah)>0)
Code: Select all
l_Writeable = CellIsUpdateable(Blah); If ( l_Writeable <0); #Insert the element, write a log file, throw a party, whatever ElseIf ( l_Writeable = 0); # Bang user on head with frying pan and tell them to stop trying to write to consolidations or rules elements, or whatever Else; #Write your value and may the gods have mercy on your soul, etc EndIf;
If you don't care whether it's un-writeable or simply doesn't exist, you could still use "< 1" as the test criterion.