Skip to Content

Deleting last entry from ResultList in an udf

Hi ,

Please tell me how can i remove the last entry in the ResultList variable result,

i have a scenario where i need to remove the last value in the result variable ONLY after the udf has completed execution is there any method like result.delete() etc or maybe result.delete(i)

Please Help

Regards

Vinay

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Aug 17, 2015 at 11:35 AM

    Hi,

    Use CollapseContext after UDF,it will give only the first values in the context.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 17, 2015 at 11:38 AM

    Hi,

    I think you can handle the same with some logic within your current UDF i.e., don't add the last value to ResultList object

    Else if you have an obvious reason you can't omit last value for some XXX reason in current UDF, create one another UDF to iterate over your current UDF output and ignore last record when you are generating new resultlist

    Br,

    Praveen

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 17, 2015 at 11:55 AM

    Hi Vinay,

    AFAIK, there is no method for the ResultList class to achieve this.

    I think you need to handle this in the udf where the result variable is getting populated by either putting a clause when it is the last value execution etc.

    Let us know providing proper screenshots if you are having any issues.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 17, 2015 at 02:38 PM

    Hello Vinay,

    Use the below UDF to remove the last Value in the queue/Context.


    Add comment
    10|10000 characters needed characters exceeded

    • Hi Vinay,

      ResultList only have these 3 add and 1 clear function, nothing similar like result.delete(i) or result.remove(i) that you asked. So, previous solution by others above should be compact enough and nothing more compact could be achieved.

      addContextChange()

      addSuppress()

      addValue(Object value)

      clear()

      Reference:

      ResultList

      Regards,

      Yee Loon