[futurebasic] Re: [FB] Doubles from resource?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2001 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Sun, 03 Jun 2001 15:50:57 +0200
Hans van Maanen wrote:
> 
> >Hans van Maanen wrote:
> >>
> >>  Hi --
> >>
> >>  I have a list of Doubles (8 bytes), in a Prefs resource. How do I
> >>  extract these? I tried something like
> >>
> >>  resH& = fn Get1Resource(_"Doub",128)
> >>  long if resH&
> >>          blockmove [resH&] + 0, varptr(a#), 8
> >>          blockmove [resH&] + 8, varptr(b#), 8
> >>  end if
> >>
> >>  but this does not seem to work at all. Someone please tell me if this
> >>  is possible at all? And do I have to set the  Preferences in FB?
> >>
> >>  Thanks!
> >>
> 
> >Hans,
> >
> >I would try something like this to see if it works:
> >
> >a# = resH&..nil#
> >b# = resH&..8#
> >--
> >
> >Cheers
> >
> >Alain
> >
> 
> Nope. Maybe I got the resource wrong? The first 8 bytes are:
> 
> 3FF199999999999A
> 
> for the first number, 1.1
> 
> If I knew how to write a double to a resource, maybe that would help...
> 
> Hans

Hans,

the Size of double variables depends on the target CPU, so it is
probably a bad idea to store double values in resources.
Try to run in 68K then in PPC to check if you notice a difference.
Perhaps you should change the storage format converting your values
to strings before storing them, you would be able to retrieve the
value with the VAL function afterwards.


-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------