How do I parse strings?

0 favourites
  • 3 posts
From the Asset Store
This collection of music is the beautiful performance of rather small strings ensemble (8 first violins, 6 second violin
  • Hi guys,

    I googled for a while, and read the expressions documentation, but I cant find the way how to parse strings.

    I want to take string data (number) entered in text box from it and use as a value for global variable. So I can write number in the texbox while runnig the app and use that value in some calculations.

    How can I do that? Thx in advance.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi,

    I'm confused, I need more info. Are you expecting different numbers in your textbox input and therefore trying to separate (parse) them into individual number data? Or are you trying to use a number typed into a textbox as a global value. If it is the latter I would do this:

    TextBox: On text changed > System: set "GlobalVariable" to int(trim(TextBox.text))

    int() changes a string into an interger and trim() makes sure you didn't accidentally hit the space bar. You can also change to condition to when button clicked if you want to wait for the full number to be typed in.

    If this has not answered your question, please give an example of what you are trying to do.

  • Yes that is what I was looking for. I did not know how to ask the question.

    Solution worked perfectly, thank you

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)