NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to iterate all Teststand File Global effectively

Recently, I'm working on a project where teststand is being used.  According to one of the user story, we need to iterate all file global. 

i just simply created one which is based on recursion. Not sure if there is any other better way to approach.   

0 Kudos
Message 1 of 2
(1,609 Views)

That's how I recurse through property objects.  I used to flatten like you are doing then iterate.  Now I just put my operations in my recursion algorithm for speed sake.  In your case you are doing O(2n) where if you put the operation in the recursive algorithm you will get just O(n).  So if you have deep trees it will take twice as long.

 

If timing is an issue it might be quicker just to iterate on the top level and delete them and then recreate them from the type definition (which has the default values).  

 

Regards,

 

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 2
(1,573 Views)