|
Returns TextIn after replacing the Placeholders in it with special characters.
- Syntax
-
TextOut = Escape(TextIn[, Param1[, Param2[, ...]]])
Part
|
Description
|
| TextIn |
Required unchanged text that contains Placeholders like |n and |1.
|
| Param1, Param2, ... |
Optional unchanged variants that replace the Placeholders from |1 through |9.
The variants get changed into text.
Note that if TextIn contains |10, Param1 replaces just the |1 part
and the zero remains in the result.
|
|
Placeholder
| |
Replacement
|
| |0 (zero) | |
Null Character | |
vbNullChar | |
Chr$(0) |
| |b or |B | |
Backspace | |
vbBack | |
Chr$(8) |
| |f or |F | |
Form Feed | |
vbFormFeed | |
Chr$(12) |
| |l or |L | |
Line Feed | |
vbLf | |
Chr$(10) |
| |n or |N | |
New Line | |
vbCrLf | |
Chr$(13) & Chr$(10) |
| |r or |R | |
Carriage Return | |
vbCr | |
Chr$(13) |
| |t or |T | |
Tab | |
vbTab | |
Chr$(9) |
| |v or |V | |
Vertical Tab | |
vbVerticalTab | |
Chr$(11) |
| || (2 pipes) | |
One Pipe | |
"|" | |
|
| |1 to |9 | |
Param1 to Param9 |
|
Remarks
Remotely similar to the printf function in C.
Placeholders are all two characters.
The first character is always the pipe or vertical bar (|).
The case of the second character does not matter.
If the character following the pipe is not recognized as a placeholder,
then the two characters are removed.
This effect is intended to discourage using unassigned placeholders
since more assignments might get added in the future.
If you want a pipe to show up in the result,
use two pipes in a row (||).
If the placeholder refers to a parameter that does not exist,
an error occurs.
Note: This function is called by LoadRequest in VbWeb.Bas.
Examples
The following causes an error since no optional parameters are passed.
Escape("9th value is |9.")
The following two examples pop up True.
If Escape("Home || Tips") = "Home | Tips" Then
MsgBox "True"
End If
OldWay = "Sure?" & vbCrLf & "YES" & vbTab _
& "Do it" & vbCrLf & "NO" & vbTab & "Stop"
NewWay = Escape("Sure?|nYES|tDo it|nNO|tStop")
If OldWay = NewWay then MsgBox "True"
|

|
|
|