peCharSet - DfBaseRichEdit
Sets or returns character set of selected text
Type: Property
Access: Read/Write
Data Type: integer
Parameters: None
Syntax
Property integer peCharSet
| Access Type | Syntax |
|---|---|
| Read Access: | Get peCharSet to integerVariable |
| Write Access: | Set peCharSet to integerVariable/Value |
Description
Sets or returns the character set of the selected text of the control.
Possible values are:
ANSI_CHARSET
DEFAULT_CHARSET
SYMBOL_CHARSET
SHIFTJIS_CHARSET
GB2312_CHARSET
HANGUL_CHARSET
CHINESEBIG5_CHARSET
OEM_CHARSET
If you get this property and it is not consistent throughout the selection, it will return the peCharSet value for the first character of the selection, and LastErrorCode will equal ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION.
Sample
This sample gets the value of peCharSet, then checks if peCharSet was not consistent throughout the selected text by checking if LastErrorCode is equal to ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION. If so, you can do any special handling you wish in the begin...end code block.
integer iCharSet iLastErrorCode
get peCharSet to iCharSet
get LastErrorCode to iLastErrorCode
if (iLastErrorCode = ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION) begin
// do something
end
Sample
This sample returns the character set of the selected text to variable iCharSet. Then, it displays a message box that displays the character set to the user.
Procedure RetrieveCharSet
integer iCharSet
get peCharset of oRichEdit1 to iCharSet
if (iCharset = DEFAULT_CHARSET) ;
send Info_Box "Default"
else if (iCharset = ANSI_CHARSET) ;
send Info_Box "ANSI"
else if (iCharset = SYMBOL_CHARSET) ;
send Info_Box "Symbol"
else if (iCharset = SHIFTJIS_CHARSET) ;
send Info_Box "Shift JIS"
else if (iCharset = GB2312_CHARSET) ;
send Info_Box "GB 2312"
else if (iCharset = HANGUL_CHARSET) ;
send Info_Box "Hangul"
else if (iCharset = CHINESEBIG5_CHARSET) ;
send Info_Box "Chinese Big 5"
else if (iCharset = OEM_CHARSET) ;
send Info_Box "OEM"
End_Procedure // RetrieveCharSet
| Col 1 | Col 2 |
|---|---|
| Note: | To use the constants displayed above in your code, you may have to include font_dlg.pkg in your code (if it is not already included):Use font_dlg.pkg |