
Active Member

October 17, 2020

Hi,
currently I'm looking how to manage something like 'truncate a text (<txt>) by 1 character of it's length', which in general is pretty easy with
Text.Start(<txt>, Text.Length(<txt>)-1)
But I want to make shure, that this will not generate an error in case the <txt> is empty. Therefore I'd like to write something like
Text.Start(<txt>, MAX(0,Text.Length(<txt>)-1))
Any idea? Thanks!
RaiSta


Trusted Members
Moderators

November 1, 2018


Active Member

October 17, 2020

Thanks Philip, thanks Velouria,
both answers seem to fulfil my needs, but I can mark only one to be an ('the') answer... so I took the first.
Will see, as soon as I'm back to the topic of interest how it works in 'free nature' - but this could take some time. And I will not set it to 'null', but to the original text, because only 'truncatable' texts will be modified. This will be just a safety issue, to cover rare cases outside my test environments, that the query will not throw an error which might not be able to be handled from persons using my design. You know: it works well in all tested cases and 99.xxx% of all applications. But after long time of working all of a sudden an 'unexplainable' error shows up, me maybe no longer at hand or whatever else. Just to be prepared...
Thanks for your contributions,
RaiSta
1 Guest(s)
