I've done it....
You are going about it all wrong actually....there are many ways but here is one
Here's what you need to do:
1. save the objects into an array such as: TEMPARRAY=[object1,object2,etc....]
2. place the integer value of its position in the array into the lbsetdata
i.e. if your array was [object1,object2,object3] then you would
lbsetdata[12345,0,"0"]
lbsetdata[12345,1,"1"]
lbsetdata[12345,2,"2"]
3. to retrieve selected unit use the data in a CALL statement
for example if I had highlighted the third object in the list then:
SELECTION= lbData [12345,lbCurSel 12345]
call format["RETRIEVEDOBJECT=TEMPARRAY select %1",selection]
what this does then is retrieve the "2" and assign it to variable SELECTION then rewrites a statement as:
RETRIEVEDOBJECT=TEMPARRAY select 2
and then executes it and assigns object3 to variable RETRIEVEDOBJECT
edit: btw... I am pretty sure you cannot convert an object into a string, and then turn the string back into an object. I wouldn't bet my life on it, but I would bet yours