."   ,"   S"   Z"   TYPE   S>Z   Z>S

." (--- <string>)

The word ." can only be used in a compiled definition.

At runtime, it displays the text between this word and the delimiting " character end of string.

Example:

: TITLE
    ."      GENERAL MENU" CR
    ."      ============" ;
: line1
    ." 1.. Enter datas" ;
: line2
    ." 2.. Display datas" ;
: last-line
    ." F.. end program" ;
: MENU( ---)
    title cr cr cr
    line1 cr cr
    line2 cr cr
    last-line ;

" (--- addr len)

The word " defines a literal character string. Text included in the string is delimited by a quotation mark. This word can be used within a definition:

: title ( --- str) " GENERAL MENU" ;

The execution of title drops the memory address on the data stack where the content of the string is stored, and the number of characters to take into account account from this address.

In our example, the address placed on the stack corresponds to the location memory containing the letter M of the string GENERAL MENU, the length being that of the channel in question.

The word " and the text of the string must be separated by at least a space character.

," ( --- <string>")

Append a string at HERE.

S" ( --- <string> | --- addr len)

Compile string into flash.

: myString ( --- addr c)
s" This is a string test" ;
myString  \ push on stack addr len  of 'This is a string test'

z" ( --- <string> | --- addr )

Specific ESP32forth

Compile zero terminated string into definition.

z" mySSID"
z" myPASSWORD"  Wifi.begin

WARNING: these character strings marked with z" can only be used for specific functions, network for example.

TYPE ( addr c ---)

Display the string characters over c bytes.

Example:

: hello ( --- addr c)
s" Hello world" ;
\ on gForth:
hello                   \ stack  2141733944 21
type                    \ display: Hello world
hello drop 5 type       \ display: Hello

TYPE in ESP32forth

In ESP32forth, the word type is a vectorized execution word. Here is the list of vectors associated with type:

S>Z ( addr c --- addr' )

s" TEST"    \ push addr len on stack
s>z         \ leave addr' on stack

Z>S ( addr1 --- addr2 len )

z" TEST"    \ push addr1 on stack
z>s         \ leave addr2 len on stack