PRB: Character String Over 254 Characters Uses SET MEMOWIDTH

ID: Q95242

1.02 2.00 2.50 2.50a | 2.50 2.50a 3.00

MS-DOS               | WINDOWS
  kbprb

The information in this article applies to:

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:   kbprb
KBSubcategory: FxprgGeneral
Keywords          : kberrmsg FxprgGeneral 
Version           : 1.02 2.00 2.50 2.50a | 2.50 2.50
Platform          : MS-DOS WINDOWS

Last Reviewed: May 22, 1998