![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Filters using a string to define a filter Topic Summary: Created On: 7-Sep-2004 09:49 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Having a bit of a problem with DXl this morning I loop through a table producing a list of IDs that I want to filter another table on
I can create the string with no problems however i cant seem to find a way to convert a string to a Filter. if i do Filter f2 string FilterString = "(attribute \"Object Text\" == 1802) || (attribute \"Object Text\" == 1803) " f2 = FilterString Dxl wont compile if there a way to use a legit constructed filter string to set a Filter ? or I am barking up the wrong tree Thanks |
|
![]() |
|
![]() |
|
Hi,
I also haven't succeded with whole definition as parameter, but it can be done this way: string attName = "Object Text" string val1 = "1802" string val2 = "1802" Filter f = (attribute attName == val1) || (attribute attName == val2) Well, it is not exaclty what you wanted, but maybe it helps... |
|
![]() |
|
![]() |
|
That would work with small lists, however and I should have posted this the first time, my lists can be failry long , one example list is 95 entries long
Having to create a filter manually like that would make my fingers bleed ![]() just seemed strange to me that Telelogic provide a way of getting a current filter as a string, but dont seem to have the reverse function |
|
![]() |
|
![]() |
|
Well, to save your fingers, than there is another possibility: generate your DXL code automatically parsing your table by another script.
This is just an example of such code generation: ----- Stream batchDXL = write "filters.dxl" int id=1 for element in table do { FilterString = your_code_to_get_it id++ batchDXL << "Filter f" id "= " FilterString "\n" } ------ in the filters.dxl you have all the f1....fn you want to. |
|
![]() |
|
![]() |
|
This one is off the wall, but if you get REALLY stuck, try something like this:
Manually create a filter similar to the one you want create with DXL. Apply it. Run the following code: Filter fltCurr = current string Summary if (!null fltCurr) Summary = stringOf(current Module, fltCurr) else Summary = "<no filter defined>" print "Current filter = [" Summary "]\n" Presumably you'd type in something like the result in your DXL. - Louie |
|
![]() |
|
![]() |
|
I can create the Search string with no problem, All I seem unable to do is apply this string as a filter. Lenka's idea would work I think but what I really want is to be able to set a filter to a legitimate Filter String.
I semi solved the problem by using a Skip list but this doesnt seem as elegant a solution as using a filter. Edited: 8-Sep-2004 at 14:44 by Anthony Ridding |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Filters using a string to define a filter
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.