How to get the raw bytes by which a value is represented

asked 2020-01-26 20:08:11 +0100

Lupp gravatar image

updated 2020-01-26 20:09:47 +0100

[The question is not completely academic, but I wouldn't conceal the fact that I don't expect to make much use of probable answers (due to age e.g). If you also tend to consider things just for interest you will understand me.]

Years ago I sometimes accessed/manipulated the values of variables I used in programs written in Pascal accessing the bytes they were kept in directly. In Pascal this is easy thanks to the 'absolute' clause available for variable declarations. (I don't know C sufficiently but it also knows the concept.)

I never found a way to do this in Basic (LibO Basic here). Of course I can use a DLL for the purpose, and I actually did it successfully for a kind of "proof of concept" concerning the usability in Calc about 2 yeras ago. (If you are interested I can provide the little DLL and spreadsheet document with a few lines of Basic code demonstrating the bitwise manipilation of 'Double' variables.)

The question finally is: Is it possible in Basic, probably with the help of an uno object?

edit retag flag offensive close merge delete