Addind content to the string in a loop w/o overwriting

Addind content to the string in a loop w/o overwriting

  

Hi there again Outsystems community.

I'm struggling here with something that should be pretty basic (and I can actually implement very easily in any other language)

I have a loop which verifies something and if that happens happens, it will add text to a variable.
My main problem is that the string gets overwritted by the latest loop run (obviously), and I would like to add text to it and not overwrite.

For example in any other language it could be very easily done on the expressions by adding + at the end and beginning of each expression, in Outsystem it don't work, but I'm guessing it should be pretty simple.

Here some images to let you understand the context.

https://s33.postimg.cc/6q337xs8v/String.jpg

Solution

Hi Pedro,

In the Movements assign simply do  

Movements 

 = 

Movements + ListRecords1.List[i].Text.Value

Solution

Hi Pedro,

Please find here with attachment  OML file . I hope this example  will help you 

Cheers,

Rocky

André Rodrigues wrote:

Hi Pedro,

In the Movements assign simply do  

Movements 

 = 

Movements + ListRecords1.List[i].Text.Value

I feel so ashamed now.
I was trying things like  +ListRecords1.List[i].Text.Value +

+""+ListRecords1.List[i].Text.Value+""+

Completelly failed to remember that I could simply summon the variable name -.- The curious thing is that 2 of my colleagues failed too to help me. Impressive how super basic stuff can lock us for more time than it should. Many thanks to André and to the rest of the repliers

Pedro Nunes wrote:

(..)

Completelly failed to remember that I could simply summon the variable name (..)

No worries, sometimes you just miss the obvious, despite it being "right there".

Happy to help, 

Cheers