Topic
  • 1 reply
  • Latest Post - ‏2014-02-26T20:39:10Z by llandale
lokeshchaitanya
lokeshchaitanya
8 Posts

Pinned topic how to print the Level 1 header along with other data using dxl

‏2014-02-26T19:51:06Z |

 

 

In the below code snippet, can you please suggest along the belowstatus what i am printing also i need to print the Level 1 Heading under which the object ID is preseent

Since i am beginner in this dxl scripting i am asking some of the silly doubts, could you pelase help me in this regard.

 

//DXL Script to print the Pass/fail status.
 
 
Module m = current
 
Object o = null
 
string oot = ""
const string sOutFileName = "c:\\temp\\MyFile.csv" 
Stream out = write sOutFileName
int oid
int Count = 0
 
for o in m do {
 
oot = o."Test Classification"
 
if oot == "Step" then
 {
  oot = o."L3R2 Pass or Fail"
 
  if (oot == "Pass" or oot == "Fail") then 
  {
Count ++
 
    //print  oot
            //Do nothing
  }
  else
  {
oid = o."Absolute Number"
print oid "\t" "Pass/Fail status is not updated for this object ID" "\n"
out << oid "," "Pass/Fail missing" "\n"
 
  }
   }
 
 
 
}

 

 

  • llandale
    llandale
    3035 Posts

    Re: how to print the Level 1 header along with other data using dxl

    ‏2014-02-26T20:39:10Z  

    Let me scribble a function that should help:

    • Object GetLevel1Parent(Object in_obj)
    • {  // get the ancestor object that is level 1.
    •    // if this object is level 1 then return that
    •    if (null in_obj) return(in_obj)   // coding error
    •    Object oParent = in_obj
    •    while (level(oParent) != 1)
    •    {  oParent = parent(oParent)
    •    }
    •    return(oParent)
    • }  // end GetLevel1Parent()

    So your code can find this level 1 object and then print it's "Object Heading" value.

    -Louie