The #Dim preprocessor directive, even though the documentation does not mention it, can be used without specifying the intended type of the variable, as in:

    #dim x

However, this defeats the purpose of this directive; among other things, this prevents Studio from performing completion of properties/methods/etc.

It is recommended that a type be declared at all times, as in, for example:

    #dim x as %Integer

The #Dim preprocessor directive allows to write, for instance:

    #dim x as %Integer = 2

However, this has a hidden consequence of generating an additional statement in the code, even though this is a preprocessor directive. The above is in fact equivalent to:

    #dim x as %Integer
    set x = 2

Pages