How to get a float value the pointer points to?
Posted
by aleluja
on Stack Overflow
See other posts from Stack Overflow
or by aleluja
Published on 2010-04-05T14:09:01Z
Indexed on
2010/04/05
14:13 UTC
Read the original article
Hit count: 201
Hello,
In my app, i've created the TList type list where i store the pointers to 1 string and 2 float(real) values for every 3 items.
aList.Add(@sName); //string
aList.Add(@x1); //float
aList.Add(@x2); //float
Then, i want to get the values out from the list, but i could only do that for string
sStr := string(lList.items[i]);
But i couldn't get the float values as a := real(lList...)
will result in an invalid typecast error.
So what do i do to get the float values?
Of course i have a question if that string casting will actually give me the string value. I'm not good at pointer stuff so i don't know how to do it.
© Stack Overflow or respective owner