Graphics

 View Only
  • 1.  Xpression - constrain user input text?

    Posted 06-07-2023 09:39

    Novice Xpression user, modifying a project I built during training.  Project took user text input, converted to time format, did some stuff, then spit out a countdown time.  Works great except if the user added a line return in the published target time input.  So I'm looking to constrain user input, preferably to 5 characters (eg, 09:55) with no ability to add line returns.   Thoughts?  Thanks in advance!



    ------------------------------
    Bob Woodhead
    Johns Creek United States
    ------------------------------


  • 2.  RE: Xpression - constrain user input text?

    Posted 06-08-2023 10:22

    Just guessing here.  I doubt that you can prevent a line return from being in a text box.  If you want it to be free to type whatever into that box, a line return is a character that can be typed.

    On the character limit.  That is an option on layout side to select to max a maximum number of characters available in a text box. - https://youtu.be/qnU0C09avdU



    ------------------------------
    Garrett Hall
    Overtime Elite
    ------------------------------



  • 3.  RE: Xpression - constrain user input text?

    Posted 06-08-2023 10:46

    Yes, so easy!  Just set a hard limit of 5 characters.  It'd been so long I forgot that was there.  Thanks!



    ------------------------------
    Bob Woodhead
    Johns Creek United States
    ------------------------------



  • 4.  RE: Xpression - constrain user input text?

    Posted 06-09-2023 04:28

    Here is another way. Put the script into input text object

            Dim charlist() As Char = {" ", Chr(10), Chr(13), Chr(9)}
            Text = Text.Trim(charlist)


    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------



  • 5.  RE: Xpression - constrain user input text?

    Posted 06-09-2023 09:03
    And the expert approach!   Always good to see how to do it scripted. 

    Thanks Roman.

    -----------

    Bob Woodhead (c) 770-855-8217

    CoolNewMedia.net






  • 6.  RE: Xpression - constrain user input text?

    Posted 06-09-2023 09:15

    You can also put this on a text object "OnSetText" (where 5 = number of characters from the left you want to stop at).

    This will only show once you type in sequence, you won't see this is layout. It will also work for datalinq objects. 

    text = left(text, 5)



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------