Page 1 of 1

Allow pairing keywords "ForEach" and "With"

Posted: Thu Jul 19, 2018 8:28 pm
by Mistrel
Working with long variable names for collections and ForEach is extremely verbose:

Code: Select all

Structure ListStruct
  fieldA.s
  fieldB.s
EndStructure

Structure SomeStruct
  List someLongListName.ListStruct()
EndStructure

someLongVariableName.SomeStruct

ForEach someLongVariableName\someLongListName()
  Debug someLongVariableName\someLongListName()\fieldA.s+" "+someLongVariableName\someLongListName()\fieldB.s
Next
We can already simplify this with the "With" keyword:

Code: Select all

ForEach someLongVariableName\someLongListName()
  With someLongVariableName\someLongListName()
    Debug \fieldA.s+" "+\fieldB.s
  EndWith
Next
It would be nice if we could combine these together for something even simpler:

Code: Select all

ForEach With someLongVariableName\someLongListName()
  Debug \fieldA.s+" "+\fieldB.s
Next

Re: Allow pairing keywords "ForEach" and "With"

Posted: Fri Jul 20, 2018 6:04 am
by helpy
+1

Nice idea!

Re: Allow pairing keywords "ForEach" and "With"

Posted: Fri Jul 20, 2018 9:44 am
by Josh
If you don't consider the forum 'Feature Requests and Wishlists' as personal property and occasionally use the search function, you will find the following threads in which the same has already been requested:

See here and here

With a simple +1 in one of this two threads we would have been spared another nonsense contribution in the WishLists. If you had also read the posts, you would have encountered the problems it can cause.

BTW, in the six results of my search, I came across a thread of my own that basically concerns the same thing and solves it in the same way as it is used in other programming languages.

See here