Previous Topic: ExpressionsNext Topic: Statements


Special Characters

In some programming languages like C, you use the backslash ("\)" to mark special characters like linefeed ("\n"). Desktop Management Scripting does not support the backslash as an escape sign but only as a normal character to ease path name and file handling. If you need to enter special characters, you must code the hex value of that character.

For example, to add a newline to a string in a Windows environment, add the following lines to the script:

Dim LF, CR As Char
Dim NL, str As String
LF = 0x0A
CR = 0x0D
NL = CR + LF
 .
 .
 .
str = str + CRLF;

In a UNIX environment, the CR is obsolete; and in the example shown previously, replace the NL initialization as shown in the following:

NL = LF

Frequently used codes include the following:

Tabulator (HT):		0x09
Line Feed (LF):		0x0A
Carriage Return (CR):	0x0D

Considering the previous example, in a UNIX environment the CR is obsolete and the NL initialization must be replaced by the following:

NL = LF

For ease of use, the Desktop Management Scripting provides a constant for newline that is named NEWLINE$. The interpreter takes care of the correct initialization and the value of this constant depending on the environment it is running. You only use this constant in your script. The previous example now looks as follows:

Dim str As String
  .
  .
  .
str = str + NEWLINE$

Note: This runs on UNIX and on Windows.