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: Get the selected Skiplist Values and storing into an Array
Topic Summary:
Created On: 20-Oct-2008 21: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.
 20-Oct-2008 21:58
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

How to get the selected skiplist values and store that into an array to create Enum Attributes type values?

Eg:
// I have a skiplist which will display all the users who got access to the module. Now I can select the multiple users and print.
print("Selected: " (string key skipUsers) "\n")


// Now I want to get the Selected users and assign that as a value to create multi value Enumerated attribute.
string optVal[ ] = selectedUsers

Here my problem is If i select 5 users from the skiplist, It's taking only the users which i select last, the remaining 4 values are not included. Please help. Thanks in Advance...
Report this to a Moderator Report this to a Moderator
 20-Oct-2008 22:08
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

See attached.

It gets sticky if you figure to use the Array to initialize the Dialog choice() DBE, as the array must either be defined globally or be in the same function as the realize() command. An alternative would simply to declare a really big array globally, then keep track (Count) of how many entries you put in it.

- Louie
Report this to a Moderator Report this to a Moderator
 20-Oct-2008 22:19
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

Thanks a lot for your Quick reply.

Actually the skiplist is like this"

DOORS ID Full Name Email id

39384948 Murugaraj, S Murugaraj.s@ge.com
87808090 Louie Landale Louie.Landale@...com

I am reading only the DOORS ID, the print("Selected: " (string key skipUsers) "\n") printing only the DOORS ID & I think it should work, I am testing it right now & will update soon. Once again Thanks!!

Regards,
Murugaraj S
Report this to a Moderator Report this to a Moderator
 21-Oct-2008 15:09
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

Thanks. I used your code & tested..

But I am getting arrany bounds error, Then I checked the (string key skipUsers) & print:

Its printing like this:
30700474530700456730700474630700589

It suppose to be like this
307004745
307004567
307004746
....
....
....

I never used skiplist before, firsttime i m using, so i dont know how to get the value one by one. Can you suggest me? Thanks!
Report this to a Moderator Report this to a Moderator
 21-Oct-2008 17:54
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

There may be a problem in the print command. Perhaps stage the Key before printing it:
string Key = (string key skp)
print Key "\n"

- Louie
Report this to a Moderator Report this to a Moderator
 22-Oct-2008 15:29
User is offline View Users Profile Print this message


Douglas Perez

Posts: 47
Joined: 20-Feb-2008

I'm trying to create a dialog box to update requirements.

Example:
I want the user to be able to select the attributes that are going to be update and then with this attributes selected create a dialog box or a form to start the update.

First I need to insert an array for the attribute selection, then I going to program each user requirement selected to populate the DBox

Example: if(selItem = "requirement"){
buf = DBE elem text
if(selItem = "cost"){
buf = DBE elem text

...
I have not tried this yet, because first i need to populate the array, but apparently something is wrong in the code.


Code Attached

Edited: 22-Oct-2008 at 18:28 by Douglas Perez
Report this to a Moderator Report this to a Moderator
 23-Oct-2008 14:52
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

You are declaring selAttr[] at size zero, but then trying to insert entries further down. Looks like you want to count the number of entries in the Skip (which you do), THEN declar selAttr[count]; THEN populate it. Another alternative would be to declare the array very large.

- Louie
Report this to a Moderator Report this to a Moderator
 24-Oct-2008 14:46
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

Hi Louie,

Thanks a lot for you.. I tried with your tip. But it didnt work for me. I want to create a enumerated attribute with the selected value ( user.name) by the Admin.

I used skip list to store the value, which was selected by the Admin. But I am unable to store the value into Array to create enumberated attribute.

Please help me with this. Thanks in Advance.
Report this to a Moderator Report this to a Moderator
 24-Oct-2008 17:49
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 120
Joined: 16-Jan-2008

Replace

put (skipUser, user.name, user)

with

put (skipUser, uName, user)

-------------------------
Kevin Murphy
http://www.baselinesinc.com
Report this to a Moderator Report this to a Moderator
 28-Oct-2008 05:49
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

Thanks Kevin..You are the Great!

As per your advice, I am trying to create a Module level attributes with the enum value as SSO of the user. So, when the trigger is applied I am reading this module level attribute value to send email. But my issue is I am storing the user & groups who got access to the module in a skip list. I need that value in array, so that i can create a enumerated attributes by assigining the value as user & groups.

string optVal [] = (string key (skipUsers))

I just tride the above written code, But i got Array bounds error. Please help me. Thanks!

Error:---------------------------------
-R-E- DXL: <Line:34> array bounds exceeded (-1)
-I- DXL: execution halted
Report this to a Moderator Report this to a Moderator
 28-Oct-2008 13:51
User is offline View Users Profile Print this message


Kevin Murphy

Posts: 120
Joined: 16-Jan-2008

S,

Reread Louie's advice:

You are declaring selAttr[] at size zero, but then trying to insert entries further down. Looks like you want to count the number of entries in the Skip (which you do), THEN declar selAttr[count]; THEN populate it. Another alternative would be to declare the array very large.


Good luck.

-------------------------
Kevin Murphy
http://www.baselinesinc.com
Report this to a Moderator Report this to a Moderator
 29-Oct-2008 08:53
User is offline View Users Profile Print this message


Murugaraj S

Posts: 38
Joined: 8-May-2007

Dear Kevin & Louie,
Yes, It was my mistake. I can store that value into Array and created enum attribute successfully. Thanks a lot for your help!
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.