version 1.123, 2005/12/31 15:46:14
|
version 1.124, 2006/01/18 12:56:13
|
Line 121 const Create bases 0A , 10 , 2 , 0
|
Line 121 const Create bases 0A , 10 , 2 , 0
|
drop |
drop |
THEN ; |
THEN ; |
|
|
: sign? ( addr u -- addr u flag ) |
: sign? ( addr u -- addr1 u1 flag ) |
over c@ [char] - = dup >r |
over c@ [char] - = dup >r |
IF |
IF |
1 /string |
1 /string |
Line 135 const Create bases 0A , 10 , 2 , 0
|
Line 135 const Create bases 0A , 10 , 2 , 0
|
endif |
endif |
x@+/string 0 s" '" 2rot string-prefix? ; |
x@+/string 0 s" '" 2rot string-prefix? ; |
|
|
: s>unumber? ( addr u -- ud flag ) |
: s>unumber? ( addr u -- ud flag ) \ gforth |
|
\G converts string addr len into ud, flag indicates success |
dpl on |
dpl on |
over c@ '' = if |
over c@ '' = if |
1 /string s'>unumber? exit |
1 /string s'>unumber? exit |
Line 158 const Create bases 0A , 10 , 2 , 0
|
Line 159 const Create bases 0A , 10 , 2 , 0
|
r> base ! ; |
r> base ! ; |
|
|
\ ouch, this is complicated; there must be a simpler way - anton |
\ ouch, this is complicated; there must be a simpler way - anton |
: s>number? ( addr len -- d f ) |
: s>number? ( addr len -- d f ) \ gforth |
\ converts string addr len into d, flag indicates success |
\G converts string addr len into d, flag indicates success |
sign? >r |
sign? >r |
s>unumber? |
s>unumber? |
0= IF |
0= IF |