Documentation Center

Built-In constants

You are allowed to declare constants yourself as mentioned above, but Passolo and Sax Basic also have a wide range of built-in constants. The purpose of these constants is the same as of the constants you declare yourself. They can be used to make the code easier to read, and they allow certain values to be changed, and the code would still work.

We have already seen an example of these built-in constants in the example with setting a bookmark to a specific text. We saw that the bookmarks of the translation list could be set with the following statement:

trnlst.String(1).State(pslStateBookmark) = True

In this case pslStateBookmark is a built-in constant in Passolo. It really holds a value. If you want to know the value of a built in constant try the following sub:

Sub ShowValue()
  MsgBox(Str$(pslStateBookmark))
End Sub

Running this sub should illustrate that pslStateBookmark really holds the value 8. Other built-in constants hold other values. This means, that we could also have set the bookmark with the macro:

trnlst.String(1).State(8) = True

The other version of the subroutine is much easier to read, and the built-in constants should always be preferred over hard coding the numbers.