DropCombo in EIP

Using Clarion 11.0.0.13244

I have a form with 7 list boxes with EIP. All of them have a DropCombo field. The auto-generated code is as follows:

IF SELF.FeqDropList{PROP:Selected}> 0
   GET(ProdQ,0+( SELF.Feq{PROP:Selected}))
   IF NOT ERRORCODE()
      BRW:PosProd.Q.PPro:Antall = PrQ:Antall
   END
END

This always selects the first position in the Queue. If I change the code to this:

P# = SELF.FeqDropList{PROP:Selected}
   IF P# > 0
   GET(ProdQ,P#)
   IF NOT ERRORCODE()
      BRW:PosProd.Q.PPro:Antall = PrQ:Antall
   END
END

This will work. I can’t figure out the difference between these two examples. This is an app converted from earlier versions of Clarion and there were no problems in CW9 or CW10. There is also a problem with DropList who will not scroll down.

Trond

Generated code says this:

GET(ProdQ,0+( SELF.Feq{PROP:Selected}))

Yours is doing this

GET(ProdQ,0+( SELF.FeqDropList{PROP:Selected}))

Also, SELF.FeqDropList{PROP:Selected} returns a string, not a number.
So,
IF SELF.FeqDropList{PROP:Selected}> 0
is a string comparison. Adding +0 to SELF.FeqDropList{PROP:Selected} will make it numeric.

branh
Not sure what you mean. Do you mean that the generated code is wrong?

Rick
IF SELF.FeqDropList{PROP:Selected} is a string, would not “P# = SELF.FeqDropList{PROP:Selected}” be wrong then?

But the problem is that (my) Clarion returns the wrong position in the Queue. As far as I have found out is that “SELF.FeqDropList{PROP:Selected}” returns the right position before the IF statement, but the “GET(ProdQ,0+( SELF.Feq{PROP:Selected}))” returns the first entry in the Queue.

On the other hand, no problems in previous Clarion versions.

Trond,

P# = SELF.FeqDropList{PROP:Selected} converts the value to a number when it gets stored in P#.

That’s why it works with the GET().

As Brahn pointed out, You are comparing SELF.FEQDROPLIST vs SELF.FEQ.

Look at the two values being returned by SELF.FeqDropList{PROP:Selected} vs SELF.Feq{PROP:Selected}

But the main question still remains. Why the Clarion code does not work, and why I have to make a workaround. And I can not see why my code make any difference.

I’ll reiterate. Your code is using SELF.FEQDropList{Prop:Selected} and the generated Clarion code is using SELF.FEQ{Prop:Selected} for the GET()
Put in some debug code and see what those two values return and how they are different.
The template hasn’t changed between C11 and C9.1 but perhaps the runtime (RTL) has and there is either a bug or a change in between the two FEQs.
If the runtime has changed, then either that is a bug or intentional and the template needs updating.

Thank you guys for trying to help me out here. But I’m still confused. I see in a EIP DropList the generated code is “ IF SELF.Feq{PROP:Selected}”. And that Droplist works properly.

But in the DropCombo “ SELF.Feq{PROP:Selected}” always return 1, and “SELF.FeqDropList{PROP:Selected}>” returns the right position in the Queue.

The code generated is correct in relation to the template with the mix of SELF.Feq and SELF.FeqDropList. But when I debug I found that “ SELF.Feq{PROP:Selected}” is correct in a DropList, and “ SELF.FeqDropList{PROP:Selected}” is correct in a DropCombo, not the mix.

It is okay, I have a workaround, but is it only me who have this problem? In addition, if I change to DropList instead, I cannot scroll more than the number of the drop down list.

On the other hand, I can change the template to:

#IF(%EditInPlaceTypeExt=‘DropCombo’)
#?IF SELF.FeqDropList{PROP:Selected}>0
#ELSE
#?IF SELF.Feq{PROP:Selected}>0
#ENDIF
#IF(%EditInPlaceTypeExt=‘DropCombo’)
#?GET(%EditInPlaceFEQFrom,0+(SELF.FeqDropList{PROP:Selected}))
#ELSE
#?GET(%EditInPlaceFEQFrom,0+(SELF.Feq{PROP:Selected}))
#ENDIF
#?IF NOT ERRORCODE()
#INSERT(%MoreAssignEIP)
#?END
#?END
#RESUME
#ENDIF

In a DropCombo, there are 2 controls. An ENTRY control (SELF.FEQ) and a list control (SELF.FEQDropList).

I think this is the right answer.
Appears the behavior of the runtime has changed in this regard to dropcombo controls.
Report it to SV support.