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.
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.
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.
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.