Click or drag to resize

SubStrC Function

X#
Returns a character string from the given character expression or memo field.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION SubStrC(
	cExpression,
	nStartPosition,
	nCharactersReturned
) AS STRING CLIPPER
Request Example View Source

Parameters

cExpression (Optional)
Type: Usual
Specifies the character expression or memo field from which the character string is returned.
nStartPosition (Optional)
Type: Usual
Specifies the position in the character expression or memo field cExpression from where the character string is returned. The first character of cExpression is position 1. If TALK is set to ON and nStartPosition is greater than the number of characters in cExpression, X# generates an error message. If TALK is set to OFF, the empty string is returned.
nCharactersReturned (Optional)
Type: Usual
Specifies the number of characters to return from cExpression. If you omit nCharactersReturned, characters are returned until the end of the character expression is reached.

Return Value

Type: String
Character
Remarks
SubStrC( ) is designed for expressions containing double-byte characters. If the expression contains only single-byte characters, SubStrC( ) is equivalent to SUBSTR( ). SubStrC( ) returns a character string from the given character expression or memo field. The character expression or memo field can contain any combination of single-byte and double-byte characters. SubStrC( ) will not return a value for a memo field when issued in the Debug window. To return a value in the Debug window, place the memo field name within ALLTRIM( ), and place ALLTRIM( ) within SubStrC( ). This function is useful for manipulating double-byte character sets for languages such as Hiragana and Katakana.
See Also