SEvalA Function | |
Execute a code block for each of the individual characters in a string, changing the contents of the argument as well as the return value.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION SEvalA(
cString,
cbBlock,
nStart,
nCount
) AS STRING CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static string SEvalA(
Usual cString = default,
Usual cbBlock = default,
Usual nStart = default,
Usual nCount = default
)
Request Example
View SourceParameters
- cString (Optional)
- Type: Usual
The string to scan. - cbBlock (Optional)
- Type: Usual
The code block to execute for each character encountered. - nStart (Optional)
- Type: Usual
- nCount (Optional)
- Type: Usual
Return Value
Type:
String
A string of characters that have been processed by the code block.
Remarks
SEvalA() is identical to SEval() in that they both evaluate a code block once for each character of a string,
passing the ASCII value and the character index as arguments.
The only difference is that, while SEval()
ignores the return value of the code block, SEvalA() assigns the return value to the original string.
See SEval() for details.
Examples
This example uses SEvalA() to change part of a string to uppercase:
1LOCAL cString
2cString := "He was doa."
3? SEvalA(cString,;
4 {|cChar| Asc(Upper(Chr(cCha-r)))}, 8, 3)
5
6? cString
See Also