Open akalsi87 opened 8 years ago
The following snippet complains that newval is not defined, however it is.
def slice_lines(val, start) { nlines = numlines(val) if (nlines < 2) { println("Error1.") quit(0) } newval = "" for (curr in 1 .. nlines) { line = getline(val, curr) # if (curr >= start) { println("Got line: $line") # if (curr != start) { # newval = printf("$newval\n$chompline") # } } } return newval }
Error:
Bish error: Undefined variable "newval" Abort
The real error here is:
# } } <---- this line should be commented } return newval
The following snippet complains that newval is not defined, however it is.
Error: