Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where ALLTRIM fears to tread..
Message
 
 
To
04/06/1998 08:42:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00104289
Message ID:
00104788
Views:
24
Ashley,

You do not want to use alltrim() on a column in a SQL statement, because the result column will take on the width of the first record in the result set. If the first record is "ABC" the column will only be 3 characters wide even though all the other rows may need more space. The best thing to do is alltrim() the column after the array is built by the SQL.

>I am passing the status field of the contract into the function through an SQL select. SQL columns have to be a set width, which stands to reason, so consequently, when I pass the field over, SQL sets the column width up as c(20) which is the same as the field that the value is coming from. Now that makes sense, what still gets me is the fact that the value is being passed into the function as a parameter and it is the parameter itself which cannot be trimmed, it is as if the SQL has fed through to the function and made this parameter read only, although UPPER() still works ok.
>
>The workaround I have made is just to make the various array elements 20 character wide as well and padded them out with spaces. Messy, but at least I can get on with things now.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform