skinops.getvertexweight - problem

Hi, i have a problem to get a weight of vertex.

skinops.getvertexweight myskin vertex selected_bone 

This function is incorrect, becouse an id of selected_bone r not the same as a bone id in a list of vertex weights

bonevertex = skinops.getvertexweightboneID myskin vertex selected_bone
skinops.getvertexweight myskin vertex bonevertex 

When i use this function, then ok it's correct - but only when bones are sorted in a list of vertex weights. If bones r unsorted, then the id of bonevertex return the wrong id of bone.

So how i can fix it?

I'm working with 3ds max 2013