Jump to content

Manipulating values inside a List?


This topic is 1569 days old. Please don't post here. Open a new topic instead.

Recommended Posts

hi!

 

I couldn't find a better area for this topic.

But I have a variable $RowList which is defined to contain numerical values in List(FieldA; FieldB; FieldC; FieldD,..., FieldK). That is inside a Loop ($i as a counter). I would like to do some testing for each of them in turn (like: If (GetValue($RowList; $i) > x) then set $RowList value $i to something else). And then return the modified whole list back to a variable.

 

Is that possible?

Link to comment
Share on other sites

To replace a value at index position in listOfValues, you can use:

LeftValues ( listOfValues ; index - 1 )
&
replacementValue & ¶
&
RightValues (  listOfValues ; ValueCount ( listOfValues ) - index )

Note that the result will have a trailing ¶.

 

Link to comment
Share on other sites

Note also that if you're looping over a list of values, you can add each processed value to a new list in another variable, say:

Set Variable [ $result ; List ( $result;  If ( GetValue ( $RowList ; $i ) > $x ; "a" ; "b" ) ) ]

 

Edited by comment
Link to comment
Share on other sites

This topic is 1569 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.