PRB: Character String Over 254 Characters Uses SET MEMOWIDTH

Last reviewed: April 29, 1996
Article ID: Q95242
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, and 2.5a
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS

When you print a character expression longer than 254 characters on the screen using the ?/?? command, the SET MEMOWIDTH setting will be used to control word wrapping. If you use the @ ... SAY command, error 1903, "String too long to fit," occurs.

CAUSE

The maximum size for character fields is 254 characters. If a character expression is less than or equal to 254 characters, the _WRAP variable setting will control how the variable is wrapped when it is displayed on the screen. If _WRAP = .F., the variable will wrap at the width of the current output window. If _WRAP = .T., the variable will be wrapped according to the _LMARGIN and _RMARGIN settings.

RESOLUTION

To work around this situation, you can use the SUBSTR() function to print the character expression in 254-character pieces. For example:

    ?SUBSTR(var,1,254)
    ??SUBSTR(var,255,254)

If the character expression is the result of concatenating variables, use the ?? command to continue the printing of each variable. For example:

    ?var1
    ??var2
    ??var3

Alternatively, you can use the SET MEMOWIDTH setting to increase the length of each line. For example:

    SET MEMOWIDTH TO 75
    ? var1+var2+var3

STATUS

This behavior is by design.

REFERENCES

"Quick Reference," version 2.0, page 70

"Commands & Functions," version 2.0, page 775


Additional reference words: VFoxWin 3.00 FoxDos FoxWin 2.00 2.50 2.50a
extend beyond
past
more errmsg err msg
KBCategory: kbprg kberrmsg kbprb
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.