Some Restrictions about
Working with Text Strings


As you probably already know, SiMPLE offers five different data types: Int, Int2, Float, Float2, and Text. Of these five, the Text data type requires some special attention since it is the only one that deals with non-numerical quantities.


Concatenation

As is pointed out in the SiMPLE tutorials:


          Because of the unique way in which SiMPLE handles text strings,
          the concatenation operation will not work as part of a task's (or
          function's) calling parameters. For example, the program:

         name = Keyin text ("Enter your name: ")
         Output ("Your name is " + name)

          will not compile. However, the program:

         name = Keyin text ("Enter your name: ")
         message = "Your name is " + name
         Output (message)

          will compile properly.

In addition, the keyword "Set" will sometimes not work with concatination statements. For example, the statement:

         Set a = "SiM" + "PLE"

will not compile. However, the statement:

         a = "SiM" + "PLE"

will compile properly.

Initializing a Text Array

Unlike with the numerical  data types (Int, Int2, Float, and Float2), a text  array can be initialized only in a Common statement. For example, the following statement:

Text a[3] = {"AB", "CD", "EF"}
will generate an error message. But the statement:
Common Text a[3] = {"AB", "CD", "EF"}
will compile correctly.

Furthermore, when initializing a text array, none of the specified text strings can contain a comma between the quotation marks. For example, the following statement:

Common Text a[3] = {"AB", "C,D", "EF"}
will generate an error message.


(All of these restrictions are due to irreparable bugs in the SiMPLE compiler.)



  [ Webmaster | FAQ's | Home Page | Contact Us ]