Topic
  • 6 replies
  • Latest Post - ‏2013-03-15T05:29:11Z by SystemAdmin
SystemAdmin
SystemAdmin
3180 Posts

Pinned topic Errors in DXL Interaction Screen when connecting through C#

‏2013-03-07T11:25:39Z |
I am using the following C# code for accessing DOORS data.

DOORSCOMLib.DOORS x = new DOORSCOMLib.DOORS();
string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" #include <E:/AnithaL/test1.dxl>;oleSetResult(c)\"";
x.runStr(DXLStr);

DOORS opens correctly, but gives the following errors in the DXL interaction screen.
getting the same DXL errors.
-E- DXL: <Line:1> incorrectly concatenated tokens
-E- DXL: <Line:1> undeclared variable (b)
-E- DXL: <Line:1> undeclared variable (P)
-E- DXL: <Line:1> undeclared variable (u)
-E- DXL: <Line:1> undeclared variable (Doors)
-I- DXL: All done. Errors reported: 5. Warnings reported: 0.
test1.dxl contains this simple function, which works perfect when I do it directly from DOORS.

int max(int a, int b)
{
if a < b then
return b
else
return a
}
print max(4,5)

Please help me to find out the mistakes.
Updated on 2013-03-15T05:29:11Z at 2013-03-15T05:29:11Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-07T11:38:00Z  

    Hi

    runStr is a method to evaluate a string.
     

    string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" #include <E:/AnithaL/test1.dxl>;oleSetResult(c)\"";
    


    Interpret the value of the string as a doors-dxl-script and you get the following script:

    Doors -u "ala12" - p "a123#" - b "#include <E:/AnithaL/test1.dxl>;oleSetResult(c)"
    

    But this does not work.


    Try:

    string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n ack max(3,7) \"\";";
    

    This should work


    Best regards
    Wolfgang

     

     

     

     

     

    Updated on 2014-01-06T10:57:41Z at 2014-01-06T10:57:41Z by iron-man
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-08T09:36:50Z  
    Thank you Wolfgang, its working perfect.
    Could you please tell me this also, how I can get this value ie 7, in C# code?

    Regards,
    Anitha
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-08T12:28:57Z  
    Thank you Wolfgang, its working perfect.
    Could you please tell me this also, how I can get this value ie 7, in C# code?

    Regards,
    Anitha

    You can try the same procedure as we can use in eval_

    In eval_ exists a return_ which itself returns only and onyl a string. So the very first task is to assign the result to a string and then to perform a return_().
     

    string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";
    
    Updated on 2014-01-06T10:57:54Z at 2014-01-06T10:57:54Z by iron-man
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-14T09:58:56Z  

    You can try the same procedure as we can use in eval_

    In eval_ exists a return_ which itself returns only and onyl a string. So the very first task is to assign the result to a string and then to perform a return_().
     

    <pre class="javascript dw" data-editor-lang="js" data-pbcklang="javascript" dir="ltr">string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";"; </pre>
    I tried with this code to get the data,

    string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";
    x.runStr(DXLStr);
    But this result_ returns certain DXL errors.

    If my DXL has the following lines, how I could get the Test Description data in my C# program. ie; What are the changes needs to be done in C# side as well as in DXL side? Please consider I am very new to DXL.

    string GetTestDescription()[]{
    Module m=read("/PlayGround/Anitha/Testcases/DVP Doors",false)

    string TestDesc[]={};
    Object o;
    int i=0;
    for o in m do
    {
    TestDesc[i]=o."Test Description";
    i++;
    }
    close m
    return TestDesc;
    }
  • llandale
    llandale
    2986 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-14T19:43:01Z  
    I tried with this code to get the data,

    string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";
    x.runStr(DXLStr);
    But this result_ returns certain DXL errors.

    If my DXL has the following lines, how I could get the Test Description data in my C# program. ie; What are the changes needs to be done in C# side as well as in DXL side? Please consider I am very new to DXL.

    string GetTestDescription()[]{
    Module m=read("/PlayGround/Anitha/Testcases/DVP Doors",false)

    string TestDesc[]={};
    Object o;
    int i=0;
    for o in m do
    {
    TestDesc[i]=o."Test Description";
    i++;
    }
    close m
    return TestDesc;
    }
    [1] Run this from the DXL window to see errors in your string.
    • print checkDXL("halt;#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";)
    I don't think you need the <\"\">as the last line and I think the command is "return_" not "result_".

    [2] You MUST decide the exact size of the array when declared. The general structure is:
    • int Size = figure out how many I need; in your case count the objects
    • string Asize
    • for (i=0; i<Size; i++) populate A[i].

    [3] The array is on the stack in the function and you CANNOT return it as a function result ..err.. when you do it will get erased on your next function call. I don't recall the weird code-around; but I'd use a Skip list.

    -Louie
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Errors in DXL Interaction Screen when connecting through C#

    ‏2013-03-15T05:29:11Z  
    • llandale
    • ‏2013-03-14T19:43:01Z
    [1] Run this from the DXL window to see errors in your string.
    • print checkDXL("halt;#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";)
    I don't think you need the <\"\">as the last line and I think the command is "return_" not "result_".

    [2] You MUST decide the exact size of the array when declared. The general structure is:
    • int Size = figure out how many I need; in your case count the objects
    • string Asize
    • for (i=0; i<Size; i++) populate A[i].

    [3] The array is on the stack in the function and you CANNOT return it as a function result ..err.. when you do it will get erased on your next function call. I don't recall the weird code-around; but I'd use a Skip list.

    -Louie
    Thanks, I could find out the errors using checkDXL(), the DXL is working fine now. It should be return_.
    Next part is I need to find out a way to return the values in C#, for which I will start a new thread after closing this.