Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Replacing a boolean operator
Topic Summary: Replace "or" "and" by values derived through code
Created On: 24-May-2007 23:27
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 24-May-2007 23:27
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

I am working on a script that will search for one or more words in the object text, and if found will copy the  object text to a new object in another module. I am using the regular expressions and the 'if ' function to find the objects and do the rest.
The relevant portion of the code is attached. I want to select "and" "or" through the radio button DBE and use that value as the boolean operator in the 'if' function. The function does not work when I replace the "or" "and" with the value derived through code from the DBE output.
Probably I am following the wrong path. Will someone advise me how best I can do it?
Report this to a Moderator Report this to a Moderator
 25-May-2007 00:11
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

The only way you can use a string as an operator is with:
-- eval_
or
--where DOORS evalutes a string to a script where there are several cases.


However, you can test tje string and then branch based on the test.

ie.,

if(selectOne=="or") print "or"
     else print "and"

Edited: 25-May-2007 at 00:24 by ron lewis
Report this to a Moderator Report this to a Moderator
 29-May-2007 19:12
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

Thanks for the tip, Ron. I used a workaround through the use additional of boolean variables to identify the "And" "Or" entry in the dialog box.

- Krishna
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.