Re: s>number? beginner question

Bernd Paysan <[email protected]> Thu, 05 Mar 2020 12:49:32 +0100
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <2055418.T9fk9SFWvP@daiyu>
Am Donnerstag, 5. März 2020, 10:35:07 CET schrieb Robert Sander:
> Hi,
> 
> could somebody explain why I only get three cells with zeroes when
> using s>number?
> 
> Example:
> 
> " 123" s>number? .s <3> 0 0 0  ok 3

The standard word for strings is S" with space and then the string.

s" 123" s>number? .s <3> 123 0 -1  ok 3

The non-standard extension with the string recognizer you are using doesn't 
need the space, and includes it in the string when you have it there.

"123" s>number? .s <3> 123 0 -1  ok 3

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o id: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
https://net2o.de/
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEERJ1NDqPQRwYnwBjr9y2Uk5MtoGcFAl5g50wACgkQ9y2Uk5Mt
oGchnA/7B/QIgmU537R3M+iie2HX+EjELqhfSAn6tk1RYbLV5TEhdi0bQQa/IOTl
GrPOOfroru8WomBrg4HE6j59jLtB8ydZ34Z973bd4cmMjJBZke1VyxX0Z9EWbTEY
fjwDs68ZFetV5YXm3dvY+ML0Fik7UTJqrCy71RLd+x/IuMFMS+DPHWMd6zBaj9IA
mJjdIxAy5z9UZ1qRAH/zxHy70zxUIn6H/htakIFl/NcyhJKd0B8DpYijfUCF/wX5
JmYg7kJEMsYwenMFiN13b9khrpKMeal0/rcfpwKwKLjZg8gEEQwalepWcwTIMvBc
BV8+Y3wXy//CXeGeRGZiQtDiXjFH1/PCGYWEnhKisAj3LOvv7cDhPdbIC3LLfuaO
6J0nrCMDzjL4F76SObfl2Bn4ZqgLOR3rtISHHmYmCW1YVc6MmbegzaUi/i4HIkSJ
5eC9W5JlqS1BbubNQbYktx6SqlXrTj3qZAfd9haE1roImiw8xSVxymbgM9zmR5If
JWonbBTQvI75RaTnUnNOmsaqamKGU2tNLyylqKoReO/7Nb5CfEzkPdS+MUnBmYXJ
df1agtW8d05fh9M2DsQy6GMHEPHCrUdn264ClUh4y5MJqOeAo/WJKoV1gzMy0zfh
Gs6fxeGIdpX4RLaEgSjMvlRrcoRsKqx0CGnnh1EjZpVdxeBpWMg=
=ZVre
-----END PGP SIGNATURE-----