programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: Floating Point Within A Dialog

From: <wheath_at_comcast.net>
Date: Wed, 04 May 2005 11:19:59 +0000

Not only does the floating point package need to be initialized in every callback but the floating point stack also has to be allocated. 'N0 the float stack pointer is NOT initialized for callbacks.
However, you don't want to allocate the stack too many times or you run out of memory for the callback and get a Dictionary Full error message from Swiftforth.
 I use the following successfully,
: INITFP ( - )
  <<F 'N0 @ HERE <> \ see if this callback has been initialized yet
           IF 16 FSTACK \ so only once per callback
           THEN /NDP F>> ; \ /ndp needs stack allocated first

The callback has to use this for every message received but some messages use the same ram, hence the 'N0 test.
Warren Heath ( wheath at comcast.net )

-------------- Original message --------------

> Thanks Gene and Rick. I did try initializing the floating point stack =
> in the callback (no luck) but didn't mention it. Although the the FP =
> package includes an /NDP in an "onenvload:" statement it didn't occur to =
> me that the callback also needed it.
>
> -----Original Message-----
> From: Gene LeFave [mailto:gene_at_tekdata.com]
> Sent: Tuesday, May 03, 2005 2:01 PM
> To: sftalk_at_forth.com
> Subject: [sftalk] Re: Floating Point Within A Dialog
>

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed May 04 2005 - 04:22:41 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:19 PST