szabgab / code-maven.com

The content of the Code-Maven site
https://code-maven.com/
30 stars 54 forks source link

when I try run this code #165

Closed Samuelcloud07 closed 1 year ago

Samuelcloud07 commented 1 year ago

https://code-maven.com/groovy-for-loop-break-continue

def valoclonint = Integer.parseInt(valorclones)

                    for (int j = 1; j < valoclonint; j++) {

                     println "valor de i "
                        println  j 
                        println   valoclonint

the var valoclonint is from a file.json tha have num: 5

but when run the for dont stop in 5, run 52 time

image

this is very wear I am novato

Samuelcloud07 commented 1 year ago

This issue was solved with for (int j = 1; j < (valoclonint as integer); j++) {

szabgab commented 1 year ago

Excellent, then I can close this.