• Tutorials

  • Home
  • GPDL Literals



    DungeonCraft Help Home

    As you should know by now, all data (and therefore literals, too) are strings.

    Sample uses of literals:

    y = $RANDOM (12);
    z = "This is a "
           "test of a long "
           "literal on "
           "short lines.";
    x = "The sum of y and z is " + y + z;

    The first example demonstrates that numbers can be used as literals. However, they are treated as strings. The missing quotation marks are assumed to be present. The only difference is that the numbers will be put into their 'canonical' form (decimal, no leading zeroes).

    The second example shows that adjacent strings are concatenated so that you do not need to write very long lines or to put a plus sign between the parts of a long string. You could do these things but the automatic concatenation makes things easier and prettier.

    The third example shows that you can mix literals and variables in an expression.