I have incorporated the AddOrRemoveValue Custom Function in my project. Thing is, when you add the first member in a list, the first character is return. I would like to remove this character, which is easy using Right(). But before I check - hum I try - if the first character is a return using Left(). This is the code:
If [ Code ( Left ( $$ListeCobinaisonAct ; 1 ) ) = 13 ]
Set Variable [ $$ListeCombinaisonAct; Value:Right ( $$ListeCombinaisonAct ; Length ( $$ListeCombinaisonAct ) - 1) ]
End If
That does not catch the return, in this case it's understandable, but it also fail with
= Code("¶")
= Char(13)
How can I check for return ? I work on a Mac, but the target is iPadOS.
How about this instead: Check the first value instead. The first character is a return (or newline or any other paragraph character) if the first value is empty.
I wish to have the values in the list separated by ',' to display the values on a single line, and it works, I get a coma after the last value. Looks like Substitute() understands ¶. Strange...
You can handle both tasks at the same time by using "guard rails" around your text. Simply add a low ascii character to both ends of the text. You then replace the combination of the guard rail and the return character, replace the guard character (in the case where the first or last character isn't a return), then add your commas.