Letters and numbers in row

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I have two edit boxes.

    1.max 15 letters in the box
    2.numbers

    add button

    then i should do this, sort in listbox as shown below

    a 100
    abc 300
    abcdeft 500

    like "abcdeft" is 7 letters - 15 = 8 spaces between them,
    so the numbers is the same row no matter what you whrite in the box.

    Can someone help me how to do this?

    Thanks

    Please login to see this attachment.

    Fusion 2.5 - Examples
    Go toPlease login to see this link.

  • To align the numbers to the right, you'll need to run a fastloop the numbers of times needed. Run the loop 15 - length(string) times. In the case of abcdeft that would make it loop 8 times. On each loop you add " " to the string. Then, you add the number.

  • Add button = Start "loop" 15 - value("Length") times = Edittext$( "Name" ) + string$( "String" ) + Edittext$( "Numbers" )
    On loop "loop" = Set alterable String " "

    I know this won't work right but how do you use 'On each one of "String" name "loop"'?

    I only get one " " space between them?

    Fusion 2.5 - Examples
    Go toPlease login to see this link.

  • MuddyMole - when I run your example it works fine. But when I copy the code into another project it doesn't work anymore!!!!

    I know it's same code...

    Please login to see this attachment.

    Fusion 2.5 - Examples
    Go toPlease login to see this link.

  • That's not a monospaced font that you're using. You need to use a font where all characters (including spaces) are exactly the same width - in most fonts, a "W" character is very much wider than an "i" character, for example.
    In my example, I changed the font to "Courier", but there are plenty of others to choose from (I believe "Consolas" and "Lucida Console" come pre-installed on Windows systems).

    Edited 2 times, last by MuddyMole (April 15, 2020 at 12:30 AM).

  • eg. If you had two players, with the names:

    Jill
    Emma

    They're both 4 letters long, but you'd have to add another SIX spaces (spaces are also very narrow characters) onto the end of "Jill" before it takes up as much screen space as "Emma".

    With monospaced fonts, this is not an issue, as all characters are of equal width. The downside is that there's less variety in monospaced fonts, and they tend to be pretty ugly a lot of the time:
    eg. Please login to see this link.
    Just look at how the "m" has been squished and the "i" has gained those strange serifs. On the other hand, you can't get much more retro-futuristic than OCR-A ( Please login to see this link. ), if that's the aesthetic you're going for...


    One thing I would say is that you may actually be better off displaying each list entry as two separate string objects, with the name left-aligned, and the score right-aligned. It would give you more control over fonts and positioning.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!