# 1.4 Creating strings

In 4tH you have to define the maximum length of the string, like Pascal. You can define a string in two ways, but you will probably find the first one the easiest:

         10 string name

You cannot add the 'CHARS' keyword, since 'STRING' already implicates that you are creating an array of characters. Note that the string variable includes the terminator. That is a special character that tells 4tH where the string ends. You usually don't have to add that yourself because 4tH will do that for you. But you will have to reserve space for it.

That means that the string "name" we just declared can contain up to nine characters and the terminator. These kind of strings are usually referred to as ASCIIZ strings.

E.g. when you want to define a string that has to contain "Hello!" (without the quotes) you have to define a string that is at least 7 characters long:

         7 string hello

When you later refer to the string you just defined its address is thrown on the stack. An address is simply a number that refers to its location. As you will see you can work with string-addresses without ever knowing what that number is. But because it is a number you can manipulate it like any other number. E.g. this is perfectly valid:

         hello                           \ address of string on stack
         dup                             \ duplicate it
         drop drop                       \ drop them both

In the next section we will tell you how to get "Hello!" into the string.