Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter sent by value not being updated
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01565124
Message ID:
01565125
Views:
54
>This has all worked very well for the last 3 years.
>
>Today, I needed to troubleshoot the way some of the return values are
>handled, but I am observing very strange behavior with the parameter I
>pass by value. For reference, here is the code:
    cMyResult = SPACE(2000)
    DECLARE INTEGER XC_eXpressLink IN XCClient.DLL INTEGER nHWnd, STRING cParam, STRING @cMyResult 
    nHWnd = _SCREEN.HWND
    N = XC_eXpressLink(nHWnd, cTransactionRequest, @cMyResult)
>I am now seeing an issue with cMyResult not being populated in certain scenarios.
>I am not sure if this is a problem with the .dll or something in VFP.

The coding technique you're using is correct. Allocate local space, pass by reference, if the XC_eXpressLink() function updates that string, it will be reflected back in VFP.

>- If run the program from the command window using DO TEST the cMyResult
> variable is properly populated with the results.
>- If I run the exact same program by hitting control+E or the "Run" toolbar button,
> cMyResult keeps the value it was initialized to.
>- If I put a set step on in the code and try to observe the cMyResult variable,
> it is always populated with the results.

I've never seen this happen before.

>In my production code, I am finding that in some screens that launch a
>payment transaction, the results are being captured and in some they are
>not. I have not been able to figure out any common denominator for the
>failed transactions.
>
>I have tried on 3 different machines running Windows 8 and Windows 7. I
>have tried two different version of the XCharge software I am integrating with.
>I have tried testing my full application in both source code and compiled, and I
>have experienced the problems in all environments.

Is there a virus on your LAN? On those machines?

>In short, I am baffled, and the provider of the payment integration software
>is as well.
>Any thoughts?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform