<-- Previous || Up || Next -->

String Width Function
String Words Class

Public Function StringWidth( _
    ByVal vValue As Variant _
    ) As Variant

Determine the width of a string in characters, assuming that backspace characters have a width of -1 (because they move the print positions back one space) and all but the carriage control characters have a width of 1.

    StringWidth("This is a test.") = 15
    StringWidth("Sm" + Chr$(8) + "ample") = 6
See also:
    WrapEachCharacter Function
Note: The MetaPhone function is better at distinguishing words which are spelled differently but may sound alike.

vValue: The string whose printed width is to be determined. Function returns Null if vValue is Null or cannot be fixed up to a String.

Note: Function uses the built-in character classification routines to determine which characters represent carriage control codes.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.