Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_List_Create( List) fails in ver 2.x

I think I've found a regression in SRP_List_Create() from at least 2.1.4 (it works in v1.6). It appears that if passed a List to create, the list doesn't actually get created, or isn't accessible. The handle returned is non-zero though.

To use your doc'd example:
// Create a list from a comma delimited array InitArray = "A,B,C,D,E,F,G,H,I,J" ListHandle = SRP_List_Create(InitArray, ",") ans = SRP_List_Count( ListHandle)
ans returns 0 instead of 10. Also, SRP_List_Locate() will fail on any item that is in the list.

However, using SRP_List_Add() to add each item to an uninstantiated list works.

Can you you replicate this??

Cheers, M@

Comments

  • Fixed in 2.1.8.0, which is on the products site. If you just want the RDK, you can download it here.
  • Wow, brilliant! Thanks for the quick response. Yes, this fixes the issue.

    Cheers, M@
  • Just curious that the generic SRP_List( 'Create', List) function doesn't have this problem. I thought that SRP_List() was just a handler for the raw methods, but this problem suggests that's not the case. Is SRP_List() its own function?, or do the raw methods call into SRP_List()?
  • SRP_List calls directly to the DLL APIs as do the raw methods. SRP_List used to be a wrapper around the raw methods, but since there was so little code, I decided the overhead wasn't worth it. At some point, I inadvertantly must have introduced the bug you witnessed in SRP_List_Create. Since we stick with SRP_List (which is just as fast as the raw methods), we never caught it.
  • Ah, I see :). I wondered about the overhead - good to hear there's no difference now. My old code just hasn't been refactored for SRP_List().
Sign In or Register to comment.