OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: jb on April 14, 2008, 06:59:08 AM

Title: String Length
Post by: jb on April 14, 2008, 06:59:08 AM
ListBox control: there appears to be a limit to the length of a string that can be returned with dcl_ListBox_Gettext.  I have a keynoting routine and if the string is longer than 208 characters the form freezes.  I'm having a hard time running this one down.  Any thoughts or known limitations with String Length and OpenDCL?

4.1.2.1
Architecture 2006, 2008
WinXP Pro

Thanks
Title: Re: String Length
Post by: owenwengerd on April 14, 2008, 10:34:04 AM
I just did a quick test with a 300 character string, and it was returned without error.
Title: Re: String Length
Post by: jb on April 14, 2008, 10:35:10 AM
Well I found it.  If the EventInvoke property is set to 1 - Allow, the text string is limited, if 0 - Keep Focus, no limitation.  Strange.
Title: Re: String Length
Post by: owenwengerd on April 27, 2008, 07:51:34 PM
This problem is due to a 256 character string length limit when passing strings to the AutoCAD command line. In Alpha 13 I've added code to detect event handler calls that exceed 256 characters, and in that case it replaces the first (presumably very long) string with "<...>". This means that if your OnSelChanged event handler needs to handle very long strings as the currently selected text, it must get the string via (dcl_ListBox_GetText) instead of relying on the sSelText argument to the event handler function.
Title: Re: String Length
Post by: jb on April 28, 2008, 04:41:02 AM
Cool, Thanks Owen!

;)