Link to home
Start Free TrialLog in
Avatar of DavidBonfoey
DavidBonfoey

asked on

How to access individual bytes in Single

I have a single that I want to access each individual byte of. How can I do this?

dim stuff as single


var1 = stuff.byte0
var2 = stuff.byte1
var3 = stuff.byte2
var4 = stuff.byte3

Thanks
ASKER CERTIFIED SOLUTION
Avatar of TigerZhao
TigerZhao

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use this.

Dim sngVar as Single
Dim bytVar() as Byte


bytVar = StrConv(CStr(sngVar),vbFromUnicode)

Debug.Print bytVar(0)
....

Avatar of DavidBonfoey
DavidBonfoey

ASKER

Thanks!

Works great!