Unconnected's Recent Forum Activity

  • I understood that once I knew you couldn't update start/end index once the loop starts. I was asking why the total of loops ran isn't the same in 'len(s) to 3' and '3 to len(s)'. I thought both would run the same amount of times. How is one giving more than the other?

    I wish how things worked were in the manual in more detail, it would prevent a lot of posts. It would be great to know how it works, but I can just use a while.

  • I tested and you are right.

    Changing either value once the loop starts doesn't change how many times the loop runs. I thought the start/end index could be updated in loop. I know they can't now, I sadly still have the same question though.

    I am confused on why 'len(s) to 3' and '3 to len(s)' is different. '100 to 3' or '3 to 100' would both result in 97. I figured the only difference is counting up or counting down. Neither start/end index get updated once loop starts, so I don't see how many times the loop runs is different. I feel I bothered you to much on this topic though.

  • Okay, so what I am getting is the start index gets checked each loop and the the end index does not.

    So 'len(s) to 3' works because len(s) is the start Index.

    ***edit***

    This post is incorrect. Both the Start index and the End index are only read once. Changing their value after the loop starts doesn't change how many times the loop runs.

  • I thought that was it, but I wasn't fully understanding it.

    It seems len(s) to 3 is in a feedback loop.

    So why wouldn't 3 to len(s) be in a feedback loop?

    I figured you would want the self adjusting number to be last instead of first.

  • Sorry to bother you again.

    Can you explain why

    For "n" from len(s) to 3 works

    and

    For "n" from 3 to len(s) doesn't.

  • That is perfect. Thank you for going out of your way. I will save the images and update a c3p soon so it has both. I need to add this to a c3p tutorial anyway. I understand all of the steps and I just wasn't sure how to go about it. I will be sure to give you credit in a comment and post the c3p link to the original post.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a base converter. I was going to offer an easier way for the user to read this "11100011010111111010100100110001100111111111111111". I was thinking an option to put spaces in it.

    I can read and understand Line 1 and Line 2, but I would like to be sure. You are comparring len(TextInput.text) modulo 3 to Zero? Are you going off of the fact that the spaces will be set when the string is being entered?

    I was wanting to take "1110001" and convert it to "111 0001". I should have been clearer, but what you did is a great idea if I understood that correctly.

  • Yes, that solved it. I always feel silly when the solution is that simple. Do you happen to know how to add a space or a comma every 3 character spaces? A 50 character string can be hard to read.

  • I have a read-only TextInput object. I am trying to fit in a 50 character string, but I need all of it to be visible, I can only see about 24 characters. Is there any way I can see all 50 characters at once without changing font size? I figured if I adjusted the height size of the TextInput it may character wrap but it didn't. I also tried using a text object. I can't highlight it to copy/paste it though, like I can with a TextInput object.

    I am open to other suggestions, as long as the user can manually copy and paste the string.

    ********************

    Solution example is in this c3p.

    dropbox.com/s/1v415k8h85jp2wa/Tutorials.c3p

  • I thought about that after posting, but wasn't sure about it. I tried it after your post though. It took me a few tries, but I figured it out replace(List.SelectedText," ","")

  • I have a List Object with a few Items listed. Instead of making an Event for every List Item, I want to set a LocalStorage Key to List.SelectedText.

    I am curious if whitespace matters in LocalStoarge Key values, Variable values or Function names. Will it cause any issues on any devices?

    Is there an expression to get rid of whitespace in the string? I tried trim() but found out it only removes extra whitespace before or after the string and not in the string.

    Tagged:

  • You do not have permission to view this post

Unconnected's avatar

Unconnected

Member since 6 Apr, 2016

Twitter
Unconnected has 1 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies