I received this query by email: "How can I convert an 8-byte/64bit string containing a IEEE754 double precision number into the numeric value itself". This is a problem of converting a data structure from one representation to another, something which in other languages would often be achieved using a union.
Liberty BASIC doesn't have unions, and nor does LBB, but at least in LBB it is easy to simulate one. This is the solution I offered the enquirer:
Code: struct union1, string as char[9]
struct union2, number as double, pad as char[1]
union2.struct = union1.struct
union1.string.struct = chr$(119)+chr$(190)+chr$(159)+chr$(26)+ _
chr$(47)+chr$(221)+chr$(94)+chr$(64)
print union2.number.struct
Here I create two structures, union1 and union2 (which are the same size) and then I set their addresses to be equal. Now anything written into one of the structures can be read from the other in an alternative format; the conversion can just as easily be done in the other direction. I've written up this technique at the LBB Wiki.
This method doesn't work in LB 4, and normally I'm not keen to promote LB-specific workarounds here, but for the record this is how the same conversion can be achieved if for some reason you're not willing or able to use LBB:
Code: struct union1, string as char[9]
struct union2, number as double, pad as char[1]
struct temp, temp as ptr
union1.string.struct = chr$(119)+chr$(190)+chr$(159)+chr$(26)+ _
chr$(47)+chr$(221)+chr$(94)+chr$(64)
temp.temp.struct = union1.struct
union2.struct = temp.temp.struct
print union2.number.struct
Richard.