Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
An FPDos bug ?
Message
From
28/06/1999 01:59:33
 
 
To
28/06/1999 00:13:05
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00234624
Message ID:
00234631
Views:
21
>Hi,
>
>While using FP DOS I call a UDF from a SQL SELECT. I was surprised to find out that TRIM() does not work seem to work within the function! The code is this:
>
>SELECT FormatData(cX) AS cX FROM xx INTO CURSOR Y
>
>FUNCTION FormatData
>PARAMETER tcData
>lcNewData = ...
>RETURN lcNewData
>
>
>After getting funny results I paused within the function and
>tested through the DEBUG window that TRIM("aa ")+"." is not
>"aa." Does anybody know why? Have I gone through the looking glass?
>

In all probability, the width of the field returned from the UDF isn't uniform, and so the first resolution of the expression is seting up the maximum field legth, so that some values of the resultant cursor are truncated, or padded to the initial length of the field with trailing spaces.

Returning a variable length value from the UDF is the root of your problem.

>TIA,
>
>Alex
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform