String lengths

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
 
A

Allen Browne

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().
 
T

Tom Lake

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top