Jump to content
UBot Underground

Newbie Question: "invalid map <K,T> key"


Recommended Posts

I'm trying to read a variable from a list item:

 

Set(#MyValue, $list item(%MyList, 0), "Global")

 

The debugger shows that %MyList contains items but I get this error message:

 

Script Error:

invalid map <K,T> key

Source: > > Set

 

What am I doing wrong?

Link to post
Share on other sites

 

I'm trying to read a variable from a list item:
 
Set(#MyValue, $list item(%MyList, 0), "Global")
 
The debugger shows that %MyList contains items but I get this error message:
 
Script Error:
invalid map <K,T> key
Source: > > Set
 
What am I doing wrong?

 

 

Could you please post the data that is stored in your list item?

Maybe it has something to do with what you have in the list item. I can test it here on my side.

 

Dan

Link to post
Share on other sites

Thanks, Dan. My list items do look like this:

 

B00FY7NCPO
Martin
Molsted
 
 
and I try to set them like this:
 
Set(#MyValue, $list item(%MyList, 0), "Global")
Set(#MyValue1, $list item(%MyList, 1), "Global")
Set(#MyValue2, $list item(%MyList, 2), "Global")
Edited by JensH
Link to post
Share on other sites

I just tried:

 

set(#tmp"B00FY7NCPO
Martin
Molsted""Global")
add list to list(%test1$list from text(#tmp$new line), "Delete""Global")
set(#test1$list item(%test1, 0), "Global")
set(#test2$list item(%test1, 1), "Global")
set(#test3$list item(%test1, 2), "Global")

 

And that works fine in V5 and in V4.

 

Is that one giving you the same error?

 

Dan

Link to post
Share on other sites

Thanks for your fast reply. Yes, I'm running 5.0.7

 

Does this mean there's no solution except to downgrade?

If you are a newbie I would suggest you downgrade, since your learning experience will be more pleasant.

 

v5 still has a lot of bugs so I believe a lot of times you won't know if the problem is in your code or it's actually a bug. Or at least get v4 so you can test the code in it, if you are having problems in v5.

 

No matter what you have in your list that code should work!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...