What is wrong with this user-defined function? (Base Report Writer) The associated field on the report prints as blank. Delivery_Days is a text column. Is_On_Hold is a Boolean column. Lunch_Count is a binary column. Delivery_Days and Lunch_Count are good because the function worked before I introduced the condition on Is_On_Hold. Is_on_Hold I know is good because I am using it elsewhere. Lunch_Tue_Thu is the name of the function. It is initialized in Initial value….
Being Is_On_Hold boolean shouldn’t be (NOT Is_On_Hold).
The negative (like !bool_variable). Don’t know how is the syntax for NOT here.
Or <> TRUE (?)
Just a guess of course.
@CRDF yeah, maybe. Who knows?
I am a C++ programmer. To me saying if (b == true) is just a verbose synonym for if (b). One might just as readily say if((b == true) == true)
[var]=“true” is (a.) what I saw in some LO doc somewhere, and (b.) is working for a conditional print expression.
I have tried and tried and tried things. I wish there were a definitive answer, and I wish there were a debugger, or something that would say “syntax error here”==>
There is apparently some sort of gross error here, despite the green checkmarks. It is not simply failing to compute my intended result; it is failing to return a result at all (apparently).
Despite my misgivings, I kept “trying things.” Apparently & is not a supported operator (it is the string concatenation operator). That’s why all my variants of the [Is_On_Hold] test produced no joy. The logical AND function is provided by AND(condition1;condition2;...)
.
The winning formula is [Lunch_Tue_Thu]+IF(AND([Delivery_Days]<>"MWF";[Is_On_Hold]<>"true");[Lunch_Count];0)
Fine.
Out of curiosity: it works with the value only, as expected.
NOT
As I would hope! Good to know. Thanks,
CM