Operations Orchestration Support and News Forum
Showing results for 
Search instead for 
Do you mean 

Nested Loops in HPOO?

Occasional Collector

Nested Loops in HPOO?

Hi all,


Im trying to implement a simple nested loop within HPOO and im running into some problems. Basically the pseudo code im trying to recreate in HPOO is:


for( int j = 0; j < 5; j++ )


      for( int i = 0; i < 10; i++ )


                      AddEmail( i + j * 10 ); Send();




Ther only problem im having is when i try to do mathmateical operations on flow variables. So, for example, im using Counters, and the resultText of Counters are strings. However when i parseint them, it adds on decimal places which i cant seem to get rid of, and so i am unable to use the resulting integer.


Has anyone made a nested loop in HPOO?

Trusted Contributor

Re: Nested Loops in HPOO?

[ Edited ]

You can't use the mathematics HPOO operations within the HPOO loop (../util/math and comparison/multiply)?


if you need to do it within the scriptlet


try {
  var myNumber = parseInt(counter); // where counter is your 'number' string
  myNumber = myNumber.toFixed(0); //remove the decimal place, rounds the number
} catch (e) {
  // error handling


see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed