• ED-like paragraphs

    From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Fri Mar 7 20:06:52 2025
    From Newsgroup: comp.lang.forth

    Using ED-like paragraph words for mulitple lines of text.

    *P ( ccc</n.> -- ) Print multiple lines of text

    *P
    Print multiple lines of text
    until a period appears
    on a line by itself.
    .


    *A ( ccc</n.> a -- a u ) Add multiple lines of text to buffer

    pad *A
    Add multiple lines of text
    to given buffer until a period
    begins a newline.
    . i. cr type

    Add multiple lines of text
    to given buffer until a period
    begins a newline.

    *, ( ccc</n.> -- ) Compile multiple lines of text


    : *, rtc back allot drop trek here *a ;
    +voc


    Compile g-string

    here *,
    Now is the time
    For all good men
    To come home.
    . here om 2value gFoo

    i. cr gFoo type

    Now is the time
    For all good men
    To come home.

    Compile counted string
    : *,s rtc back here om 1- swap c! trek here 0 c, *, ;
    +voc

    create: sfoo *,s
    Now is the time
    For all good men
    To come home.
    . i. cr sfoo tell

    Now is the time
    For all good men
    To come home.

    -fin-

    --- Synchronet 3.20c-Linux NewsLink 1.2