Hello, Mike!
Yes, the screenshot is visible.
You described the strange behavior of the program. I just repeated your test code, pasted the formula into cell A2 and changed cell A1 several times - everything works without errors. Please tell us more about your LibreOffice and operating system.
Thank you. That fixed it but I’m sure I tried that before (as used by VBA), obviously, I had something else wrong too.
Mike.
Edit, I’m thinking JohnSUN must have not been using basic.
Edit2, why does it say dat isn’t defined rather than return is a syntax error?
Edit3, realised that return is valid but the dat after it isn’t. However, still seems an incorrect error.
Oh, “why, why”! Just because I was wrong! Looking at the screenshot, I opened IDE and just out of habit, I wrote it down correctly myConvert = dat, and not as shown in the screenshot. Yes @karolus , you are more attentive than me
the downside is: Calc does only a lookup in ~basic/Standard for UDFs (UserDefinedFunctions) for other languages than BASIC you need to build whole some_addinn.oxt with boilerplate around.