Microsoft KB Archive/33304

= Toolbox Library Routine String Arguments Have 255-Byte Limit =

Article ID: 33304

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 1.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Interpreter 3.0 for Macintosh

-



This article was previously published under Q33304



SUMMARY
The Toolbox Library routines that utilize string variables are limited to strings of 255 characters or less. The Toolbox Library routines make ROM calls that use Pascal strings limited to 255 characters in length.

For example, the MBLC Toolbox routine GetDialogText will only take the first 255 characters from an edit field, even if there are more than 255 characters of input. It does not give an error message; it just ignores anything past the 255th character.

This information applies to Microsoft QuickBASIC Version 1.00, Microsoft BASIC Compiler Version 1.00, and Microsoft BASIC Interpreter Version 3.00 for the Apple Macintosh.



MORE INFORMATION
The following is an example that runs in the BASIC interpreter Version 3.00 or in the BASIC compiler Version 1.00 for the Macintosh (it will need to be modified for QuickBASIC): 'The following program uses a dialog box located in the resource fork 'of the DialogRes program on the &quot;BASIC Toolbox&quot; disk (in BASIC 3.00). 'The buttons on the left side of the dialog box can be ignored -- 'The program will accept input into the edit field until the OK or 'the CANCEL button is pressed. LIBRARY &quot;BASIC Toolbox:ToolLib&quot; ref% = 0: D! = 0: item% = 0: t$ = &quot;&quot; OpenResFile &quot;BASIC Toolbox:DialogRes&quot;, ref% GetNewDialog ref%, 1, D! WHILE item% <> 7 AND item% <> 1  'While OK or CANCEL aren't pressed. ModalDialog D!, item% GetDialogText D!, 6, t$  LOCATE 1, 1 DrawText STR$(LEN(t$))    'Print length of string from GetDialogText. WEND DisposeDialog D! 'Any characters beyond the 255th have been ignored. Print &quot;The last 20 characters of the edit field are:&quot; PRINT RIGHT$(t$, 20)

Additional query words: BasicCom MQuickB

Keywords: KB33304

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.