将字符串数组传递到批处理模式[门9.6]的DXL脚本
目的:
- 我需要将字符串(或对象标识符或整数..)的数组传递到批处理模式下的DXL脚本。
问题:
- 传递数组参数时,cmd提示符弹出,这意味着发生了错误(目前没有stderr重定向)
:
使用int array时的完整命令如下:
r'“ C:\ Program Files \ ibm \ rational \ Doors \ Doors \ 9.6 \ bin \ Doors” -d [email  procearted] -u user -p passw -p pastw -p prj -dxl“ int reqname [int reqname [] “ testplanned {} \”;字符串结果= \“ testResult {} \” - batch“ script.dxl”> D:\ output.txt'
使用.format {}在python中填充脚本,然后使用subprocess.check_output启动。为了测试它,足以启动从命令线上启动命令:
r'“ C:\ Program Files \ ibm \ rational \ Doors \ Doors \ 9.6 \ bin \ Doors” -d [email  preatected] -u user -p passw -p passw -p prj -dxl“ int reqname [int reqname [] “测试计划1 \”;字符串结果= \“ testResult 1 \”“ -batch” script.dxl”> D:\ output.txt'
作为附带注意,d:\ output.txt是
从未创建或填充,所以也许我在这里也缺少一些东西。
脚本实际上只是打印(couts)接收到的参数的值或大小:
cout<< planned "\r\n"
cout<< result "\r\n"
print sizeof(reqName)""
The goal:
- I need to pass an array of strings (or object identifiers, or integers..) to a dxl script in batch mode.
The issue:
- When passing the array parameter, the cmd prompt pops up, meaning that an error happened (no stderr redirect for the moment)
How am I doing:
the full command when using an int array is the following:
r'"C:\Program Files\IBM\Rational\DOORS\9.6\bin\doors" -d [email protected] -u user -P passw -p PRJ -dxl "int reqName[]={{1,2,3,4}}; string planned=\"TestPlanned {}\"; string result=\"TestResult {}\" " -batch "script.dxl" > D:\output.txt'
the script is populated in python using .format{} and then launched using subprocess.check_output. In order to test it, it's sufficient to launch the command fromcommand line placing like this:
r'"C:\Program Files\IBM\Rational\DOORS\9.6\bin\doors" -d [email protected] -u user -P passw -p PRJ -dxl "int reqName[]={{1,2,3,4}}; string planned=\"TestPlanned 1\"; string result=\"TestResult 1\" " -batch "script.dxl" > D:\output.txt'
as a side note, the D:\output.txt is
never created or populated, so maybe I am missing something also here.
The script actually just prints (couts) the value or the size of the params received:
cout<< planned "\r\n"
cout<< result "\r\n"
print sizeof(reqName)""
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这不会像书写一样起作用 - “ script.dxl”正在与您要求在命令行上运行的-dxl的单独上下文中评估。
另外,DXL不使用;作为终点线,因此您可能需要一般查看您的语法。
选项:
上
。在选项1中
I don't think this will work as written- the 'script.dxl' is being evaluated in a separate context from the -dxl that you're asking the item to run on the command line.
Also, dxl doesn't use ; as end lines, so you might want to review your syntax generally.
Options:
Let me know if I've misunderstood something!
Note- edited to escape backslashes in option 1