Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The number in Replicate creates a problem
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
The number in Replicate creates a problem
Miscellaneous
Thread ID:
01684050
Message ID:
01684050
Views:
88
Hi,

I am troubleshooting the following issue. And I can't figure out what causes it.

A somewhat long SQL Select has the following segment:
REPLICATE(' ',10-LEN(ALLTRIM(REFERENCE)))
The purpose of the above is to create a string of entity codes (nbsp) equal to the number of spaces after some entry in a field. The field name is REFERENCE. It used to be up to 10 characters in length. And the user was able to enter only up to 10 characters. And the above code worked.
Then I increased the length of the field to 15. But the entry in the field is still the same, less or equal to 10 characters.
Now the above code does not work. The SQL Select returns the error:
String is too long to fit.
If I change the 10 in the above REPLICATE with 15, no error.
REPLICATE(' ',15-LEN(ALLTRIM(REFERENCE)))
I don't understand why? Since the entry in the REFERENCE field is still only up 10 characters, the code 10-LEN... should work. Unless I miss something obvious.

TIA for any explanation
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform