![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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!!!! |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Need help of the size of a string
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.