> > More...
> > 
> > Dim TestSingle As Single
> > Dim pp As Pointer
> > 
> >  TestSingle = 33.1
> >  pp = VarPtr(TestSingle)
> >  
> >  SinglePtr(pp) = 33.1 is False! Gives -2...
> > 
> > Jussi
> 
> Actually SinglePtr() cannot work on local variables, because internally
> there is no "Single" local variable, only "Float".
> 
> Thanks for detecting that weird thing!

Full Single management has been implemented in revision #3296.

Note that floating point constants (33.1 for example) are always Float. So if 
you compare SinglePtr(pp) to 33.1, the Single value returned by SinglePtr() is 
converted to a Float before doing the comparison, and so the values do not 
match.

To force a Single comparison, do: SinglePtr(pp) = CSng(33.1)

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to