![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Pattern wizard in the kitchen Topic Summary: copying first 20 char of object text to attribute Created On: 27-Nov-2007 11:18 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Louie Thanks! You helped me out very well. There seems to be an error in line 38. For now I put a // in the beginning of the line. Then the script runs and gives the desired result. I will study the code in detail later. Regards, Elbert | |
![]() |
|
I am looking for regular expression to copy the first 20 characters of object text to a attribute. e.g. object short text.
|
|
![]() |
|
![]() |
|
There is no need for a regular expression, nor for the kitchen library:
(current Object)."Object Short Text" = ((current Object)."Object Text" "")[0:19] As this approach may waste space in the string table, you might want to consider buffers: Buffer b = create b = (current Object)."Object Text" b = b[0:19] (current Object)."Object Short Text" = tempStringOf b delete b Regards, Peter |
|
![]() |
|
![]() |
|
Peter, thanks for the suggestion.
I tried to avoid working directly in DXL because I just started working with DOORS. Working in DXL means programming a whole script. The pattern wizard in the Kitchen provides a user just to load a pattern and if necessary change the number of characters to be placed into the attibute. |
|
![]() |
|
![]() |
|
Well, I don't find the pattern wizard in the Kitchen, could you tell me where it is? And secondly, it is not a bad idea to start getting into DXL, you will need it anyway sooner or later.
Regards, Peter |
|
![]() |
|
![]() |
|
The Dutch Kitchen was supplied with a Pattern Wizard.
Apparently it is unavoidable to start using DXL. ![]() Do you have a suggestion how to apply your script for all object in the module? Thanks in advance. Regards, Elbert |
|
![]() |
|
![]() |
|
There are basicially two object loops:
[1] for obj in mod do. This loop respects the current display set, which means if deleted objects are not showing the loop won't find them, and if objects are filtered out the loop won't find them. I only ever use this loop if I have some kind of module interactive script where the user may run the script multiple times on the same module, adjusting the display each time. [2] for obj in entire mod do. This loop finds each object starting from the top, regardless of display state. This loop will work the same way regardless of filtering or sorting or leveling or which view is loaded. I routinely use this loop. Right after the loop I typically exclude objects I don't want to deal with. See attached. Didn't try it, so if you get DXL errors then try to fix them. - Louie Edited: 27-Nov-2007 at 15:32 by Louie Landale |
|
![]() |
|
![]() |
|
Louie
Thanks! You helped me out very well. There seems to be an error in line 38. For now I put a // in the beginning of the line. Then the script runs and gives the desired result. I will study the code in detail later. Regards, Elbert |
|
![]() |
|
![]() |
|
// I wonder if this is better: ??? if (length(buf) > TruncateLength) length(buf) = TruncateLength ???
It is orders of magnitude faster ... when executed 10.000 times, length(buf, TruncateLength) executes in 0 seconds, the original approach in 5 seconds. As for line 38, just add the last closing bracket after cell(oCurr) (there should be 3 of them). Regards, Peter |
|
![]() |
|
![]() |
|
Peter,
Thanks for the extra info. I changed your suggestion: if (length(buf) > TruncateLength) length(buf) = TruncateLength to: if (length(buf) > TruncateLength) length(buf,TruncateLength) then a module with over 6000 objects runs in 2 seconds (before 5 seconds) regards, Elbert |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Pattern wizard in the kitchen
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.