NUMBER? word in EFORTH 
Author Message
 NUMBER? word in EFORTH

          Can anyone help, the standard EFORTH word-set includes the word
NUMBER? which converts a number string entered interactivly by the user.
Although it accepts hex numbers e.g $4000, it does not conform to the
usual FORTH and allow you to enter a double number e.g 123.45

Can anyone help by providing a modification of the EFORTH source for the
word. Follows below .......

  Alternatively....
  Provide a seperate word to allow you to enter a double number on the
  stack.

  Thanks in advance.

/ --------------------- Source starts here -----------------------------

: NUMBER? ( a -- n T, a F )


  IF HEX SWAP BYTE+ SWAP 1 - THEN ( a 0 b' n')


  IF 1 - ( a 0 b n)



      ELSE R> R> ( b index) 2DROP ( digit number) 2DROP 0
      THEN DUP
  THEN R> ( n ?sign) 2DROP R> BASE ! ;

  --------------------------------------------------------------------------
        Bernie Mentink   ( Christchurch N.Z. )

              .... Some things have to be seen to be believed,
                   Most things have to be believed to be seen ....
  -------------------------------------------------------------------------



Sun, 04 Jun 1995 09:39:20 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. eForth FOR/NEXT words on 8051 MCU

2. Puzzler: Numbers to Words

3. Puzzler: Numbers to Words

4. Writing double word binary numbers on screen

5. Parsing numbers vs word sentences

6. Numbers to Amount in Words

7. word number in edit field

8. words and numbers

9. Converting numbers to words... Hand coding

10. Castle - Numbers To Words Template HELP!

11. Numbers to words, here's some code.

12. How to convert a number to words

 

 
Powered by phpBB® Forum Software