alex009988
07-30-2019, 10:09 AM
I need to rewrite c++ program to vba.
I've made a function and the sub, but I dont know how to write this for loop correctly in vba
for (pos=pos-1; a[pos] == 0; pos--)
{
}
Unfortunately this dosent work as this is not a good option to write after "To" something like a(pos) = 0.
For pos = pos - 1 To a(pos) = 0 Step -1
Next pos
I've got extra consultation in this thread http://www.cplusplus.com/forum/beginner/258650/
So I need to create for loop that search first a(pos) = 0 from right to left in the array.
It start from pos=pos-1 and ends by when a(pos) = 0. Any idea how to write this loop for vba?
Regards,
Alex
I've made a function and the sub, but I dont know how to write this for loop correctly in vba
for (pos=pos-1; a[pos] == 0; pos--)
{
}
Unfortunately this dosent work as this is not a good option to write after "To" something like a(pos) = 0.
For pos = pos - 1 To a(pos) = 0 Step -1
Next pos
I've got extra consultation in this thread http://www.cplusplus.com/forum/beginner/258650/
So I need to create for loop that search first a(pos) = 0 from right to left in the array.
It start from pos=pos-1 and ends by when a(pos) = 0. Any idea how to write this loop for vba?
Regards,
Alex