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: Need help of the size of a string
Topic Summary:
Created On: 6-May-2005 19:42
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-May-2005 19:42
User is offline View Users Profile Print this message


Ed Roland

Posts: 12
Joined: 13-Apr-2005

Is there a size limited on a string? If so, how can I allocate the size to it? What is a max length of a string?
I have a dynamic string in the program that fails due to the size of a string is too large.

Thanks so much!!!!
Report this to a Moderator Report this to a Moderator
 9-May-2005 08:42
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Avoid large strings, they cause serious memory leak problems.
You should use Buffers wherever possible.
Buffer memory is dynamically allocated and you can free it up after use, so size is not a problem.

As an aside there is a maximum to the size of string that can be stored in a string attribute.
This is defined in the constant maximumAttributeLength.



-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 10-May-2005 21:57
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I don't think there's a limit on the length of a string variable.

If you mean attributes of type "string" rather than type "text"...

Yes. Run the following from your DXL window to print the maximum number of characters a string attribute can contain:

print (maximumAttributeLength) "\n"

In v71 I just got 968. For v61 IIRC it was something link 467.

Be advised that "string" attributes cannot contain special characters like tabs and EOLs "\t" "\n".

- Louie
Report this to a Moderator Report this to a Moderator
 11-May-2005 15:57
User is offline View Users Profile Print this message


Ed Roland

Posts: 12
Joined: 13-Apr-2005

Thanks for all the replies. Anyways, I found the solution for my DXL code.

Here is the story. I used the IPC function to send a command and receive data back from an external server and store it into a string. Everything works fine if only small data return, but when there's a large data returns from an external server, the receive funciton only receives portion of it. So, I thought there's a limited characters of a string and went to try using a buffer, but it still receives portion of data. Then I do multiple receives and it receives everything.

Therefore, this has nothing to do with the string data type, the problem was caused by the recv function in IPC.

FYI, attached my dxl code of the IPC function with multiple receives.
Report this to a Moderator Report this to a Moderator
 11-May-2005 22:04
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Nit-Pick: Your "allData= allData response" code is a nightmare. Concatenation is a big enough memory waster and DOORS slow-downer, but doing so recursively is an exponential disaster. You clearly should use a buffer, allDataBuff += response; then extract the string after the loop: allData = stringOf(addDataBuff); delete(allDataBuff).

Doing such things cut down a big program I had from 3-days running to 2 hours.

- Louie
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.