Hi all,
string RifFilename = "C:\\Documents and Settings\\...\\...\\rifExport.xml"
current = folder "/folder_xy"
Folder parent = current
string targetname = null
string targetDesc = "Description"
string RifDefName = "DefName"
string RifDescription = null
string s = ""
DB myDB = null
s=importRifFile(RifFilename, parent, targetname, targetDesc, RifDefName, RifDescription, myDB)
if(s!="")
{
print "Error occured: " s "\n"
}
VBdo - Mon Feb 21 05:09:06 EST 2011 |
Re: Mistakes with dxl script in Batch Mode If I was to put my finger on the problem, I think it's either the myDB Dialogue Box call or the statement "print "Error occured: " s "\n" or both. Batch mode cannot raise the DXL Interaction window to display the print statement during batch mode. Same goes for any dialogue boxes. Do I get any marks or did I fail miserably? Paul Miller Melbourne, Australia |
Re: Mistakes with dxl script in Batch Mode SystemAdmin - Mon Feb 21 05:30:28 EST 2011 Paul Miller Melbourne, Australia |
Re: Mistakes with dxl script in Batch Mode VBdo - Mon Feb 21 05:38:53 EST 2011 Over to Louie, Mathias or others to solve this one. Paul Miller Melbourne, Australia |
Re: Mistakes with dxl script in Batch Mode 1. In batch mode your script will be executed at a different context as in "Interactive Mode". In Interactive mode DOORS will create its own DXL context and add { attrDxlName = ...; obj__ = ...; your script goes here } to your script, I think that won't happen in batch mode. Therefore in batch mode your script will conflict, since "parent" is already defined on top level (and is a function). 2. In batch mode other include files than in interactive modes are loaded at startup. It may be that one of the includes already defines a 'parent' variable or function. So you should: a) use a different name for your variable (or b) wrap your program in curly braces to avoid the name clash. Regards,Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Mistakes with dxl script in Batch Mode Mathias Mamsch - Mon Feb 21 06:25:32 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS a) was right for me! |
Re: Mistakes with dxl script in Batch Mode VBdo - Mon Feb 21 07:37:42 EST 2011
|
Re: Mistakes with dxl script in Batch Mode llandale - Mon Feb 21 11:55:26 EST 2011
|
Re: Mistakes with dxl script in Batch Mode lsand - Thu Apr 14 16:28:31 EDT 2011 |
Re: Mistakes with dxl script in Batch Mode lsand - Thu Apr 14 16:30:00 EDT 2011 |
Re: Mistakes with dxl script in Batch Mode lsand - Thu Apr 14 16:32:02 EDT 2011 Option B says that if this works on-demand:
infoBox("Whatever")
{
infoBox("Whatever")
}
|
Re: Mistakes with dxl script in Batch Mode SystemAdmin - Mon Feb 21 05:30:28 EST 2011 Paul Miller Melbourne, Australia
Dear Experts,
-E- DXL: <config/colmenu.inc:24> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:24> undeclared variable (alwaysOn)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:28> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:28> undeclared variable (columnSelected)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:34> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:34> undeclared variable (alwaysOn)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:37> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:37> undeclared variable (columnSelected)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/formal:29> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formal:29> undeclared variable (lockSection)
Included from:
<Line:1>
too many messages -- suspending error reporting-I- DXL: all done with 516 errors and 0 warnings
-E- DOORS: DXL contains 516 errors
-E- DXL: <config/formalheading:23> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formalheading:23> undeclared variable (alwaysOn)
Included from:
<Line:1>
-E- DXL: <config/formalheading:26> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formalheading:26> undeclared variable (columnSelected)
Included from:
<Line:1>
-E- DXL: <config/formalheading:45> incorrect arguments for function (createMenu)
Included from:
<Line:1>
-E- DXL: <config/formalheading:45> undeclared variable (canSortMap)
Included from:
<Line:1>
-E- DXL: <config/formalheading:47> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formalheading:47> undeclared variable (canSortAscending)
Included from:
<Line:1>
-E- DXL: <config/formalheading:47> undeclared variable (canSortAscendingMap)
Included from:
<Line:1>
-E- DXL: <config/formalheading:50> incorrect arguments for function (createItem)
Included from:
<Line:1>
too many messages -- suspending error reporting-I- DXL: all done with 13 errors and 0 warnings
-E- DOORS: DXL contains 13 errors
string out_filename
const string sourceModuleName = "/M3AR/Modules/HRCX/LLR_SW_HRCX"
Baseline b = baseline(2,0,"BASELINESET_CRCX_07.06_08.10")
const string colId = "Req.ID"
const string colCode = "Source Code"
/*
* function for exporting the given module to csv file
* the columns to export are defined below
*/
string exportToCsvPld(string mName, string viewName)
{
Module m = current
string attrbName
Object o
string inhalt
string separator = ","
string hochkomma = "\""
m = read(mName, false)
if (null m) { errorBox "Failed to open module " mName "."; return }
else current = m
load(m,b,true)
load view viewName
out_filename = out_filename ".csv"
if (canOpenFile(out_filename, false)) deleteFile(out_filename)
Stream app = append out_filename
app << hochkomma
app << colId
app << hochkomma
app << separator
app << colCode
app << "\n"
app << hochkomma
app << "__View__"
app << hochkomma
app << separator
app << hochkomma
app << "View: " viewName " / Baseline: " (major b)"."(minor b)" "(suffix b)
app << hochkomma
app << "\n"
for o in current Module do {
inhalt = o.colId
app << hochkomma
app << inhalt
app << hochkomma
app << separator
app << hochkomma
inhalt = o.colCode
app << inhalt
app << hochkomma
app << "\n"
}
close app
close m
close current Module
return("")
}//string exportToCsvPld(string mName, string viewName)
/* first count all Items */
Item m
int numberOfItems =0
Project p
for p in database do for m in p do if (type(m) == "Formal") numberOfItems++
/* read all modules to string array, for further use in list box */
string modules[numberOfItems]
int i =0
for p in database do {
for m in p do {
if (type(m) == "Formal") {
modules[i]=fullName m
i++
}
}
}
out_filename = (getenv "TEMP") "\\traceability\\requirements"
exportToCsvPld(sourceModuleName, "SW CPLD DO-Release view")
if (batchMode) exit_
|
Re: Mistakes with dxl script in Batch Mode vasgyuszi - Tue May 17 10:26:06 EDT 2011
Dear Experts,
-E- DXL: <config/colmenu.inc:24> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:24> undeclared variable (alwaysOn)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:28> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:28> undeclared variable (columnSelected)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:34> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:34> undeclared variable (alwaysOn)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:37> incorrect arguments for function (createItem)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/colmenu.inc:37> undeclared variable (columnSelected)
Included from:
<config/formal:20>
<Line:1>
-E- DXL: <config/formal:29> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formal:29> undeclared variable (lockSection)
Included from:
<Line:1>
too many messages -- suspending error reporting-I- DXL: all done with 516 errors and 0 warnings
-E- DOORS: DXL contains 516 errors
-E- DXL: <config/formalheading:23> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formalheading:23> undeclared variable (alwaysOn)
Included from:
<Line:1>
-E- DXL: <config/formalheading:26> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formalheading:26> undeclared variable (columnSelected)
Included from:
<Line:1>
-E- DXL: <config/formalheading:45> incorrect arguments for function (createMenu)
Included from:
<Line:1>
-E- DXL: <config/formalheading:45> undeclared variable (canSortMap)
Included from:
<Line:1>
-E- DXL: <config/formalheading:47> incorrect arguments for function (createItem)
Included from:
<Line:1>
-E- DXL: <config/formalheading:47> undeclared variable (canSortAscending)
Included from:
<Line:1>
-E- DXL: <config/formalheading:47> undeclared variable (canSortAscendingMap)
Included from:
<Line:1>
-E- DXL: <config/formalheading:50> incorrect arguments for function (createItem)
Included from:
<Line:1>
too many messages -- suspending error reporting-I- DXL: all done with 13 errors and 0 warnings
-E- DOORS: DXL contains 13 errors
string out_filename
const string sourceModuleName = "/M3AR/Modules/HRCX/LLR_SW_HRCX"
Baseline b = baseline(2,0,"BASELINESET_CRCX_07.06_08.10")
const string colId = "Req.ID"
const string colCode = "Source Code"
/*
* function for exporting the given module to csv file
* the columns to export are defined below
*/
string exportToCsvPld(string mName, string viewName)
{
Module m = current
string attrbName
Object o
string inhalt
string separator = ","
string hochkomma = "\""
m = read(mName, false)
if (null m) { errorBox "Failed to open module " mName "."; return }
else current = m
load(m,b,true)
load view viewName
out_filename = out_filename ".csv"
if (canOpenFile(out_filename, false)) deleteFile(out_filename)
Stream app = append out_filename
app << hochkomma
app << colId
app << hochkomma
app << separator
app << colCode
app << "\n"
app << hochkomma
app << "__View__"
app << hochkomma
app << separator
app << hochkomma
app << "View: " viewName " / Baseline: " (major b)"."(minor b)" "(suffix b)
app << hochkomma
app << "\n"
for o in current Module do {
inhalt = o.colId
app << hochkomma
app << inhalt
app << hochkomma
app << separator
app << hochkomma
inhalt = o.colCode
app << inhalt
app << hochkomma
app << "\n"
}
close app
close m
close current Module
return("")
}//string exportToCsvPld(string mName, string viewName)
/* first count all Items */
Item m
int numberOfItems =0
Project p
for p in database do for m in p do if (type(m) == "Formal") numberOfItems++
/* read all modules to string array, for further use in list box */
string modules[numberOfItems]
int i =0
for p in database do {
for m in p do {
if (type(m) == "Formal") {
modules[i]=fullName m
i++
}
}
}
out_filename = (getenv "TEMP") "\\traceability\\requirements"
exportToCsvPld(sourceModuleName, "SW CPLD DO-Release view")
if (batchMode) exit_
Batch Mode lacks functions dealing with GUI and that's why you get these DXL errors. It does not make sense to be building a GUI "menu" in an environment that has no GUI what so ever. If you are indeed trying to build GUI in batch mode then you have a conceptualization problem as to what you are trying to accomplish and how you figure to do it. You need to find another way to tell your batch program what its supposed to do, and then let it do it. Perhaps Folder fldStart = folder("\MyProj\MyFold") current = fldStart DoWhatIWant(fldStart) If you really want to schedule some task to run at a certain time but also to prompt the user as to what to do, then don't use "batch mode" you can use the '-dxl' switch to iniatiate your dialog code.
|