In some programming languages such as C, you use the backslash ("\)" to mark special characters. 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. To enter special characters, 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 the UNIX environment, the CR is obsolete; and replace the NL initialization in the previous example, as follows:
NL = LF
Frequently used codes are as follows:
Tabulator (HT): 0x09 Line Feed (LF): 0x0A Carriage Return (CR): 0x0D
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 the constant in your script. The previous example now looks as follows:
Dim str As String . . . str = str + NEWLINE$
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|