I can’t leave this un-responded to. As far as I can tell, neither of your formulas work. Nor would I expect them to.
You can’t use ranges in the stripchar( function without understanding the ordering of Unicode characters. Let’s take your first example:
The first pair is
That’s easy, it matches letters from A to Z. az and 09 are also simple.
The fourth pair in your formula is a space followed by a —. This is going to match everything from space (value of 32) to — (value of 8212). In other words, this will match thousands and thousands of characters, including comma, which has a value of 44. So commas definitely won’t be stripped out.
Your final pair is - (value of 45) to … (value of 8230). So overall, this formula will only strip out values below space (invisible control characters) and above 8230 (assorted rare unicode characters). It definitely won’t strip out commas.
If you don’t know what the value of a character is, you can use the asc( function to find out. The Formula Workshop is handy for this.
Aha, good catch Dave, I didn’t think of that. That produces a different formula and different results from just copying the text from the web page. Interestingly, when you pasted it back into the forum as code, that seems to produce the correct result. Yet another reason to ALWAYS indent formulas and code by 4 spaces when pasting them into the forum. For procedures you can easily do that automatically by using the Source>Copy Indented Code menu command.
It looks like Pages was partly responsible, and Markdown formatting is responsible for some of it. When I open your post for editing, so that I can see the text in its raw form, your two hyphens in the first formula appear as an em dash followed by a hyphen. That was probably Pages that altered it, because that’s the way it appears even in raw form. The two periods that became an ellipsis was the work of the Markdown formatting used by Discourse.
That’s Markdown at work. It converted your two hyphens into an en dash.
As Jim said above, it’s a very good idea to format formulas and code by indenting 4 spaces. In addition to the problems above, Markdown uses asterisks to indicate bold or italic, which could cause asterisks that are used for multiplication to disappear.
If you are editing code outside of Panorama, it’s best to stick to a text editor, rather than a word processor. You don’t want a word processor screwing up your code while trying to make it look pretty.
Not a question of guilty, I just wanted to clarify how the stripchar( function works both for you and for anyone that may read this thread later.
No – this is the road to utter confusion. If everyone is typing the code over and over again there is too much opportunity for mistakes. To collaboratively work on a problem, we need to make sure that we are all working with the same code. Copy and paste are the only way to ensure that, but you should only use plain text editors, and always indent code by 4 spaces when pasting into the forum, to make sure that the forum itself doesn’t alter the code.
Ok, now I do think you are guilty! I would recommend that you never edit code in a word processor. Word processors are not designed for editing text. Panorama has pretty good text editing for code, so that’s usually the best bet. If you feel you MUST use some other editor, then stick to plain text editors like BBEdit, TextMate or VSCode. Do NOT use a program that supports different text styles, like Word, Pages, Numbers, etc.