Hi,

i need to convert 4byte and 8byte HEX to single and float.
The following code works on gambas2 but seems to need modifications in Gambas3.
Any working example for Gambas3 available ?

Public Sub Button3_Click()
' i = &h3EAAAAAA& 'IEEE representation of 1/3

Dim i As Integer
Dim x As Single
Dim p As Pointer

    i = &h3EAAAAAA&

    p = Alloc(4)
    Write #p, i, 4              ' << error *
    Read #p, x
    Free(p) 
   Print x

End


*  "Type mismatch: wanted Stream, got Pointer instead"

thx wally


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to