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: Louie's tidbit #3: String Vectors as Call Parameters
Topic Summary:
Created On: 6-Oct-2003 16:13
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.
 6-Oct-2003 16:13
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

if you write function: bool NewResults(string &InString) you can modify the string variable InString and modifications are passed back to the calling program. If you do NOT put the "&" character, you can change InString but the calling program does NOT see the changes.

The reverse seems to be true for string Vectors: if you pass a string list of things to a calling function and want to modify the contents, do NOT use the "&" command: void SortString(string List[]).

This is real confusing. This "feature" seems only to apply to STRING vectors, not other data types.

Perhaps someone more fluent at "C" can respond with the reason behind this feature.

- Louie
Report this to a Moderator Report this to a Moderator
 6-Oct-2003 20:43
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 97
Joined: 14-Aug-2003

Passing in string vectors already does the "Call by reference" (passing in the address of the string vector not a copy of it). Now I must say that it would make much more sense to me to be more consistent to pass strings and string vectors in the same manner but I didn't write the interpretor.
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.