Call to a .NET method inside a FOR EACH

Posted by jquerijero on 09-Sep-2013 11:51

I have a call to a .NET method (using a class inside a custom .NET dll) inside a FOR EACH. For some reason, the record in scope goes away after the call to the .NET method.

Any ideas?

All Replies

Posted by jmls on 16-Oct-2013 00:20

can you post the portion of the affected code ?

Posted by Mike Fechner on 16-Oct-2013 02:03

What kind of method call is it? Is the call related to repositioning a Query using the Progress.Data.BindingSource?

Posted by Tung on 16-Oct-2013 03:19

There are problems with using methods inside FOR EACH blocks. See articles 000016292 and 000029112 in the knowledge base.

Posted by jquerijero on 16-Oct-2013 10:56

There is really nothing special about the for each.

FOR EACH bfttso_detail WHERE

            bfttso_detail.lDisplayOnCCDevice BY bfttso_detail.display_seq:

     IF cLine = "" THEN

       cLine = bfttso_detail.cCCDeviceOutput.

     ELSE

       cLine = cLine + CHR(3) + bfttso_detail.cCCDeviceOutput.

    ar.CreditCardPinPad:CCInterface:SendRequest(Dmsi.Agility.Payment.Commands:LinesDisplay, cLine).

     /* This fails. Record is no longer available. */

     ASSIGN

       bfttso_detail.lDisplayOnCCDevice = NO

       bfttso_detail.cCCDeviceOutput    = "".

END.

This thread is closed