Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #28414

Re: Pass a name string to a CREATE DOES> via user input

From Gerry Jackson <gerry@jackson9000.fsnet.co.uk>
Newsgroups comp.lang.forth
Subject Re: Pass a name string to a CREATE DOES> via user input
Date 2014-02-14 08:02 +0000
Organization A noiseless patient Spider
Message-ID <ldkihi$bj$1@dont-email.me> (permalink)
References <1b6c0627-940b-4ea8-b035-48d16f9bbbfd@googlegroups.com> <ldjm3d$aut$1@dont-email.me> <1e94936c-d351-4f62-96ba-8cc2ff41e2ab@googlegroups.com>

Show all headers | View raw


On 14/02/2014 02:20, hank.lenzi@gmail.com wrote:
>
>> Gerry
>
>   What can I say? This is *exactly* what I needed! Thank you!
>
>   The part I'm not sure about is how do I get leading whitespace out of it. It's not -TRAILING. WORD does it, but PARSE doesn't, right?

Yes and no. WORD loses leading delimiters, PARSE doesn't. If the 
delimiting character is a space WORD will get rid of leading spaces 
otherwise not - your delimiter is '.' so you need to do it yourself.

>
>   TIA
>
>   -- Hank Lenzi
>

: -leading  ( caddr u -- caddr' u' )
    begin dup while over c@ bl <= while 1 /string repeat then
;

s"       Hello" cr 2dup type -leading cr type
       Hello
Hello ok

Using BL <= removes any tabs and other control characters. And before 
somebody points it out, <= is not standard but easily defined

-- 
Gerry

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Pass a name string to a CREATE DOES> via user input hank.lenzi@gmail.com - 2014-02-12 17:50 -0800
  Re: Pass a name string to a CREATE DOES> via user input "Elizabeth D. Rather" <erather@forth.com> - 2014-02-12 16:01 -1000
    Re: Pass a name string to a CREATE DOES> via user input Julian Fondren <julian.fondren@gmail.com> - 2014-02-12 18:14 -0800
      Re: Pass a name string to a CREATE DOES> via user input "Elizabeth D. Rather" <erather@forth.com> - 2014-02-12 16:36 -1000
    Re: Pass a name string to a CREATE DOES> via user input Mark Wills <markrobertwills@yahoo.co.uk> - 2014-02-13 00:42 -0800
      Re: Pass a name string to a CREATE DOES> via user input Elizabeth D Rather <erather@forth.com> - 2014-02-12 22:55 -1000
  Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-13 23:56 +0000
    Re: Pass a name string to a CREATE DOES> via user input hank.lenzi@gmail.com - 2014-02-13 18:20 -0800
      Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-14 08:02 +0000
        Re: Pass a name string to a CREATE DOES> via user input "Elizabeth D. Rather" <erather@forth.com> - 2014-02-13 22:18 -1000
          Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-14 10:37 +0000
            Re: Pass a name string to a CREATE DOES> via user input "Elizabeth D. Rather" <erather@forth.com> - 2014-02-14 09:53 -1000
              Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-14 22:16 +0000
          Re: Pass a name string to a CREATE DOES> via user input albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-02-14 12:17 +0000
        Re: Pass a name string to a CREATE DOES> via user input hank.lenzi@gmail.com - 2014-02-15 11:16 -0800
          Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-15 22:54 +0000
            Re: Pass a name string to a CREATE DOES> via user input Coos Haak <chforth@hccnet.nl> - 2014-02-16 00:24 +0100
              Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-16 08:01 +0000
          Re: Pass a name string to a CREATE DOES> via user input "Elizabeth D. Rather" <erather@forth.com> - 2014-02-15 16:27 -1000
            Re: Pass a name string to a CREATE DOES> via user input Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-02-16 08:21 +0000
          Re: Pass a name string to a CREATE DOES> via user input stephenXXX@mpeforth.com (Stephen Pelc) - 2014-02-16 10:58 +0000
    Re: Pass a name string to a CREATE DOES> via user input "Elizabeth D. Rather" <erather@forth.com> - 2014-02-13 18:28 -1000

csiph-web