Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Curiosity
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00391058
Message ID:
00391193
Views:
11
>I have a custom method of my business object "oBenGenBiz.cGetOhter" that is behaving in a manner I cannot explain. Maybe someone can enlighten me.
>
>The anomaly is this: I have a statement as follows:
>
>lcRetVal=SUBSTR(lcHoldContent,lnStartPos,oBenGenBiz.nPadding).

Try this:
local lnSubstrLen
lcHoldContent=alltrim(lcHoldContent)
lnSubstrLen=oBenGenBiz.nPadding
lnSubstrLen=min(len(lcHoldContent)-lnStartPos, lnSubstrLen)
lcRetVal=substr(lcHoldContent, lnStartPos, lnSubstrLen)
Just to check each value in debugger...

>
>The values of the variables as determined programmatically ans aldo by the debugger, set the values as follows:
>
>lcRetVal was initialized as '' (empty string) at the too of the method and gets a new value here. (or should!)
>
>lcHoldContent is a character string: "[/D/customer ]"
>
>oBenGenBiz.nPadding is a business object that is fixed at 42 (numeric)
>
>Here's the puzzling part: lcRetVal show as '' after the code is run. I cannot understand why it is not instead a substring pf the lcHoldContent. I have changed the name of the variable, tried "STORE TO...", but nothing I do makes lcRetVal becme anythig except an emoty string. The same code in the Command window gives me the string as it should be.
>
>Anyone know what's going on?
>
>Thanks in advane,
>
>Jim
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform