Beginner's guide: Text blocks

segment

Use 1 in start and 6 in length. You will get first 6 letters of text. Then add dots into it by join blocks…

2 Likes

If it’s not too much to ask, could you show me en bloc? I use variables to store the text in the list.

Here are the simple blocks

image

2 Likes

I’m trying to put more than 8 and the error.

Segment: Start (1) + length (12) - 1 exceeds text length (8).

Obs: I was noticing my list, it only pulls the size of the first item on the list that has exactly 8 letters. How do I remove this limitation of 8 letters.

This post was flagged by the community and is temporarily hidden.

I don’t think I saw that

Create a loop for your list, check lenght of each word and if >12 then segment text

If it’s not too much to ask, could you show me en bloc? I use variables to store the text in the list.

Try something like this

2 Likes

It still keeps giving error. I’ll share the screen if you want to do a test.

TESTE_CERTO_Screen2 (1).ais (479 Bytes)

Can not import your screen , please post your blocks here and use Do it to debug them

1 Like

Thank you very much, after having a coffee and having more patience, I managed to solve the problem. Thank you very much!

1 Like

Why isn’t if combined with any of the blocks for Text

If and else if tests a given condition. If the condition is true, performs the actions in a given sequence of blocks, otherwise, the blocks are ignored. So the if …then block will combine only with blocks that result true or false for example from text blocks you can use the followings

image

1 Like

There are some blocks that you can not ride on, like the one in the picture
blocks

1 Like

Those blocks do not return true but you can use them in combination with others blocks

image

7 Likes

I really enjoy this guide, it’s amazing and it always help me a lot when I have any doubt about some specific text block. Congrats and thank you for sharing your knowledge and being patient to write it to guide us through.

Well, I have one doubt about the “Replace All Mappings” block on my project. I’ve been trying to implemment it in my Search ListView With Images but since my data is pretty large (more than 700) it starts lagging and take some time to show what the User is typing in the TextBox.

Here are my blocks:

Dictionary of Characters Replacement

Action to Replace

I’ve tested it in a shorter list (50 entries) and it works fine, but it does not work fine in a bigger one. Is there any other solution? Is this the right way to do it?

Thanks in advance! (Tell me if I have to create new topic instead of asking here…)

Can you tell what is not working “fine”? Maybe show the blocks that you try to use.

1 Like

Hey Peter, thank you for replying.

I’ve showed my blocks of “Action To Replace”… those are the blocks I’m using to replace all mappings in text from the list “Global Tittle” with the Dictionary blocks.

The problem is with creating the new LisView WIth Images, it gets laggy and each time I type on text box it takes some time to create the list of itens with the corresponding text.

If it is a smaller list it will work fine, but when it is a big list as I’m using (700 itens) it does not, it gets laggy as I said.

It also works fine when I don’t use the “replace all mappings”, all the new itens are showed very fast and smooth, but I need to use it for replacing characters as [ã á à ã …].

Ahh, each time I type a letter for searching the word in the list it takes some time to show in the textbox because it gets too lazy…

Because you have to run this loop multiple times in a very short amount of time, every piece of code in the loop matters.

My suggestions: (Suppose all of these are placed inside the when text changed yellow block)

  1. Check the length of text outside of the loop. This prevents unnecessary checking.
  2. I can see you run the replace all mappings in the loop. Why not run it outside the loop and store in a variable? As you said you had 700+ items in the list, every time it loops it replaces again.
  3. You don’t need to Clear the List in the loop. Clear it once only b4 the loop.
  4. The inner loop should be ran outside the loop, imagine the 700+ items again. It loops the add items for 700+ times! And because you didn’t add it for 700+ times, you dont need to clear it for 700+ times but only once.
1 Like