Roger that but can you guess why I got confused?
IMO you should have not made that note but I bet you were trying to be careful :)
I have it changed, how is it now?
Well sorry b+,
yes it looks correct now, so other people can use it without issues.
Just noticed the mistake a few minutes after my first post. Wish there would be a delay before a post is actually shown in the forum, and that one could completly revoke the post within the delay time, or at least tick it to be postponed until the author finally releases it.
Also the locking of threads comes contra productive here, as I can't change the codebox in the "Development" thread to contain the corrected version. Hence everybody who's searching the forum for BIN$ and stumbles over the buggy version first instead of the now correct version in the ToolBox, will probably use the buggy function, at least until it bites his ass.
In the future I'll restrict myself to only posting codeboxes/attachements in the "Programs" board, where no locking is active and I'm able to correct things when needed.
Oh, just see another reply, so here is the answer for that one.
The output looks as intended by me, here an example to show pos./neg. number behavior at the _BYTE barrier:
' 128 = 10000000 (8 unsigned data bits)
' 127 = 1111111 (7 unsigned data bits)
' -127 = 10000001 ( normal sign + 7 data bits)
' -128 = 1111111110000000 (extended sign + 7 data bits)
note the sign extension for -128, so it can be distinguished from +128, it's similar at the INTEGER/LONG barriers.
However, if you have better sugestions it should be easy enough to adapt the function.