The "old school" method is to use a calculation field.
The newer method would be to hide the label using Hide Object in the Inspector. Yes, you can do this with multiple objects if you use all the objects and set criteria for each. Depending on exactly how complex, the calculation field might be better.
The “even newer school” would maybe use a single-segment button bar and put the calculation into the label calculation, or employ a placeholder calculation – both of which are (mis-)used as non-official "layout calculations", until the real thing comes along …
PS: To answer your original question: Until the advent of these features, sometimes people used the calculation engine of some layout object attribute (e.g. Conditional Formatting) to define a $var that was record-dependent. Alas, that was a) a bit unreliable in refresh, and b) the calculation was hidden away within an object that you delete inadvertently …
PPS: If you use Case(), you don't have to define an empty default result:
not IsEmpty ( Contactpersons::Phonenumber ) ;
"Phone: " & Contactpersons::Phonenumber
thePhone = Contactpersons::Phonenumber ;
not IsEmpty ( thePhone ) ;
"Phone: " & thePhone
but for such a simple calculation, this is admittedly more a question of personal taste.
Again, two answers that are equaly correct! :-) Thanks guys.
As you can see I'm still learning these obvious things. I guess with time such aproaches wil occur to me automatically so I won't have to ask over here.
In the case of the database I'm working on, creating Calculation fields with the Case() function in them will work best.
Thanks and have a wondrous day!