String lengths

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I have a case where the use of Ucase on a string
causes the string to grow beyond the physical
bounds of a label caption at runtime. Is there any
way I can determine in code that such growth
will occur if I fold the string to upper case?

The situation calls for suppressing the use of
Ucase in favor of keeping the same font size.

Bill
 
Placing a character into the Format property of a text box does truncate
after 255 characters, but I'm not sure using UCase() does the same thing.

In the Immediate window (Ctrl+G), try:
? Len(UCase(String(3000, "a")))
The length of the string is still 3000.

StrConv() is an alternative if you don't like UCase().
 
Allen Browne said:
Placing a character into the Format property of a text box does truncate
after 255 characters, but I'm not sure using UCase() does the same thing.

He's not talking about the number of characters, but the physical size of
the
string in inches (or cm) which gets larger due to converting the characters
from
lowercase to uppercase. Example:

This takes a certain amount of space.
THIS TAKES A CERTAIN AMOUNT OF SPACE.

See the difference? In most fonts, the bottom sentence is
longer than the top one.

Tom Lake
 
Back
Top