Claus_Jambrich_5663

Length of text in a prompt set

Discussion created by Claus_Jambrich_5663 on May 5, 2017
Latest reply on May 5, 2017 by Wolfgang_Brueckler_1288
Your question was:
in a Prompt Set I try to catch a 8-digit Number in a text field. How is it possible to check that the input string is exactly 8 digits long. Otherwise there should be an error.

Our answer:
In the prompt set itself, you can only set a maximum length for a text input field:

zwx79lo74rp3.png

In this case, it is not possible to insert a string longer than 8 characters.

If you want to check for exactly 8 characters, this can only be done in a script, e.g. like below:

:IF STR_LENGTH(&TEXTFIELD1#) = 8
:  PRINT "Number is &TEXTFIELD1#"
:ELSE
:  SEND_MSG "JAC", "SUP", "Not 8 digits"
:  EXIT 10
:ENDIF

You will receive an error message:
5tpewj77hjtt.png

Outcomes