CALCULATION-FIELD | Escape code for special charakters

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Using Tap Forms CALCULATION-FIELD | Escape code for special charakters

Viewing 6 reply threads
  • Author
    Posts
  • October 28, 2019 at 4:28 AM #37471

    Eddy
    Participant

    Hi Folks,

    Using the calculation field to produce some text, I need to have some special characters in the result. First of all a “|”. But the field is automatically deleting every “|”, so I assume I need an escape code for that. But “\” is not working…

    So, does anybody now the escape code to be used in the calculation field?

    Thanks in advance,

    Eddy

    October 28, 2019 at 6:25 AM #37473

    Eddy
    Participant

    Played around another our. None of the escape codes i know is working. But here is a “dirty” workaround:

    Instead of the pipe “|” (U+007C ) these letters are working:

    (1) “|” (U+FF5C) FULLWIDTH VERTICAL LINE
    (2) “︱” (U+FE31) PRESENTATION FORM FOR VERTICAL EM DASH
    (3) “┃” (U+2503) BOX DRAWINGS HEAVY VERTICAL
    (4) “│” (U+2502) BOX DRAWINGS LIGHT VERTICAL
    (5) “⎮” (U+23AE) INTEGRAL EXTENSION

    Anyhow I would prefer to use an escaped pipe.

    Any ideas how?

    October 28, 2019 at 8:12 AM #37475

    Sam Moffatt
    Participant

    Try using a script field instead of a calculation field. Script fields use Javascript and are a little more lenient. It’s slightly more code but a lot more powerful. Any time I go beyond a basic calculation I jump over to a script field, easier to debug and update.

    October 28, 2019 at 9:16 AM #37477

    Eddy
    Participant

    Hi Sam!

    Thanks for this advice.

    Actually I already thought about that, but…
    if I use the calculation field, the names of the field I am using in a formula seem to be updated/actualized, whenever I change the name of a field. Yes, of course you can say, it is not the clean way to change field names, but this is what I have to do sometimes, as long as I develop.

    What I am wondering about is that: If you need a line break in the calculation field, you have to insert “\r”. So, obviously there is something like an escape code. So, how can I box special characters with an escape code? I think, I just have to learn, which coding for the characters is nessesary. Obviosly, it’s not like in java/javascript, because this I tried already…

    Regards, Eddy

    October 28, 2019 at 11:00 AM #37481

    Daniel Leu
    Participant

    Changing the name of a field doesn’t require changes to the script as long as you use the field id instead of the field name.

    October 28, 2019 at 11:02 AM #37482

    Eddy
    Participant

    Wonderful. That was my blind area!

    I didn’t know, that I have access to the field-IDs in Tapform.

    Thanks!

    Eddy

    October 28, 2019 at 11:13 AM #37484

    Sam Moffatt
    Participant

    The Script Editor has a field list on the left that will let you insert snippets with the field ID’s populated for you, either assigning the ID to a variable or creating a line that pulls the value from the field in one step. If you have linked forms, it’ll also include the fields from those as well. It’s not quite as visually smooth as the calculation editor but I think it’s a pretty reasonable compromise to support scripting in Tap Forms.

Viewing 6 reply threads

You must be logged in to reply to this topic.