General information
Category:
Coding, syntax & commands
>>this.clear
>>
>>SELECT (this.crowsource)
>>GO TOP
>>i = 1
>>
>>SCAN
>> IF EVALUATE(this.cexcludefield)
>> *-- true
>> this.additem(EVALUATE(this.cdisplayfield), i, 1)
>> this.additem(EVALUATE(this.ckeyfield), i, 2)
>> ELSE
>> this.additem("\" + EVALUATE(this.cdisplayfield), i, 1)
>> this.additem(EVALUATE(this.ckeyfield), i, 2)
>> ENDIF
>>
>> i = i + 1
>>ENDSCAN
>>
>>DODEFAULT()
>
>Bob,
>
>You need to change the i = 1 to i = THIS.NewItemID + 1
>
>and the i = i + 1 to i = THIS.NewItemId + 1
>
>This sinecessary because the combo does not reset the itemids, rather it continues to count forward in the assignment. This will be especially noticed if the combo is sorted, things will show up in the wrong places.
In my actual class I use addlistitem, and my keys are always integers. I was trying to remember from memory what I did. However, shouldn't it work if the combo is cleared and NewItemID is starting from 1?
Anyway, I find more and more that building your own combo boxes with the rowtype of 0 is much more convenient for a variety of reasons.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only