first steps


for the newbies to groovy and grails
There are many things for the experts, butfor the newbies, sometimes it´d a hard time, when justa little brick is missing.

I try to show may way to groovy and grails

Sunday, April 15, 2012

groovy: command line parameter / argument handling


used from C, but there is not argc, argv.


args (Arry og arguments) and
args.size()  number of arguments

Like this

if ( args.size() != 4  )
  { println "Anzahl Argumente " + args.size()
    println "Usage:  pdf  Gutachten-nr  Datei  Zeile1  Zeile"

def nr = args[0]
def datei = args[1]
def zeile1 = args[2]
def zeile2 = args[3]

No comments:

Post a Comment