foreach
- How-to
- Tomas Beran
- PowerBuilder
- Thursday, 15 December 2022 12:16 PM UTC
Hi
It's surprising to me there hasn't been such discussion in the past.
I'm looking for 'foreach' alternative in Powerscript. I mean: In my app I use multirow selection everywhere it's possible. Therefore iterating through for-next loop is one of the most common action I usually do. Wouldn't be nice to have a special command just for making code smaller and safer?
The idea of foreach is taken from Lua language which I see very useful:
string ls_array[]
string ls_var
...
foreach ls_var in ls_array
//do something with ls_var
next
Second idea - taken from C++ - just enhancement of for-next loop:
string ls_array[]
...
long ll_n
for ll_n in ls_array
//do something with ls_array[ll_n]
next
What's your opinion?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.