Reputation: 83
I want numbers from 1 and greater I tried 1..n, but this doesn't work So I can't do this in Range?
thanks
Upvotes: 2
Views: 1588
Reputation: 28757
This works for me:
def n = 3
def range = 1..n
range.each { println it }
Output:
$ groovy range.groovy
1
2
3
Can you provide a script that isn't behaving as you would like?
Upvotes: 3
Reputation: 16056
1..Integer.MAX_VALUE
or
1..Long.MAX_VALUE
What do you want n to signify ?
Upvotes: 3