AnandKiran
16 years agoFrequent Contributor
Want to set folder path as global property
Hi Ole,
I want to set a folder path in the Global Property and want to use it in my groovy script .
I tried defining a property called PATH with value D:/Gallery/Anand/Input
I tried to access this property using ${Global#PATH} in the script but i am getting an error.
Let me explain the script ,
Workbook Output = Workbook.getWorkbook(new File("D:/${Global#PATH}/Output.xls"))
In the above script instead of mentioning the complete path i want to access the values saved as global variable . But when i executed the script it throws an error
Error :
Mon Mar 09 11:45:56 GMT+05:30 2009:ERROR:An error occured [startup failed, Script34.groovy: 27: unexpected char: '#' @ line 27, column 60.org.codehaus.groovy.syntax.SyntaxException: unexpected char: '#' @ line 27, column 60.
When i tried :
Workbook Output = Workbook.getWorkbook(new File("D:{#PATH}/Output.xls"))
I got this error :
ERROR:An error occured [No such property: PATH for class: Script35], see error log for details
Can you help me in this issue
Thanks in advance
Anand Kiran
I want to set a folder path in the Global Property and want to use it in my groovy script .
I tried defining a property called PATH with value D:/Gallery/Anand/Input
I tried to access this property using ${Global#PATH} in the script but i am getting an error.
Let me explain the script ,
Workbook Output = Workbook.getWorkbook(new File("D:/${Global#PATH}/Output.xls"))
In the above script instead of mentioning the complete path i want to access the values saved as global variable . But when i executed the script it throws an error
Error :
Mon Mar 09 11:45:56 GMT+05:30 2009:ERROR:An error occured [startup failed, Script34.groovy: 27: unexpected char: '#' @ line 27, column 60.org.codehaus.groovy.syntax.SyntaxException: unexpected char: '#' @ line 27, column 60.
When i tried :
Workbook Output = Workbook.getWorkbook(new File("D:{#PATH}/Output.xls"))
I got this error :
ERROR:An error occured [No such property: PATH for class: Script35], see error log for details
Can you help me in this issue
Thanks in advance
Anand Kiran