Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.


2.4 Strings

A series of characters between two ' characters is known as a string. Almost any character can be used in a string, although the \ and ' characters have a special meaning. For instance, a linefeed is denoted by the two characters `\n'. We now know how to stop the message running into the prompt. Change the program to be:

PROC main()
  WriteF('My first program\n')
  fred()
ENDPROC

PROC fred()
  WriteF('...slightly improved\n')
ENDPROC

Compile it as before, and run it. You should notice that the messages now appear on lines by themselves, and the second message is separated from the prompt which follows it. We have therefore cured the linefeed problem we spotted earlier (see 1.1.3 Execution).


Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.