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: Dialog box
Topic Summary: how to initialize variables dynamically
Created On: 16-Feb-2007 13:58
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.
 16-Feb-2007 13:58
User is offline View Users Profile Print this message


Rakesh Bantu

Posts: 10
Joined: 16-Mar-2006

Dxl Friends -

I have some global variables which i initialize and use in my script.Is there a way to intialize these variables dynamically so that when i run the dxl the gui should pop up to ask for the values of these variables and initialize ,instead of hardcoding these variables in the code.. can we use dialog box ? does any one have sample code.

string file_name   = "D:\\Data\\RTM build 1.e.xls"
string funcArea   = "Functional Area"
string attr_name   = "Requirement?"
string attr_testable    = "Testable/Non Testable Requirements"
string attr_release     = "Release"
string test_id  = "Data Scenario ID"
string test_name  = "Plan: Test Name"
string test_status = "Status"
string build_attr  = "Build"

Thanks of any help
Report this to a Moderator Report this to a Moderator
 16-Feb-2007 14:06
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Here is simple example from help file if you look up field

DB fieldBox = create "Get Zip"
DBE zip = field(fieldBox, " Zipcode: ", "", 12)
void unzip(DB fieldBox) {
string zipcode = get zip
print zipcode
} // unzip
apply(fieldBox, "Lookup", unzip)
show fieldBox
Report this to a Moderator Report this to a Moderator
 16-Feb-2007 15:58
User is offline View Users Profile Print this message


Rakesh Bantu

Posts: 10
Joined: 16-Mar-2006

Thanks Ron!

DB fieldBox = create "Get Zip"
DBE zip = field(fieldBox, " Zipcode: ", "", 12)
void unzip(DB fieldBox) {
string zipcode = get zip
print zipcode
} // unzip
apply(fieldBox, "Lookup", unzip)
show fieldBox
print " Test"

I want to set the(string zipcode) as a global variable and use it in other funtions - is this possible? if i run this -the script stops after i put in the zipcode. say i add a print statement in the end it is not excuting the print statement.

Report this to a Moderator Report this to a Moderator
 16-Feb-2007 16:04
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

You can make zipcode global

The last statement executed is 'show fieldBox' -- so anything to be executed in this example has to be in the area around the line print zipcode.


If you want print "Test" to work change show fieldBox to block fieldBox.

Edited: 17-Feb-2007 at 17:59 by ron lewis
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 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 1 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.