GetCp Function | |
-- todo --
Prompts for a code page by displaying the Code Page dialog box, and then returns the number of the code page chosen.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax FUNCTION GetCp(
nCodePage,
cText,
cDialogTitle
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual GetCp(
Usual nCodePage = default,
Usual cText = default,
Usual cDialogTitle = default
)
Request Example
View SourceParameters
- nCodePage (Optional)
- Type: Usual
Specifies the number of the code page that is initially selected when the Code Page dialog box is displayed.
If nCodePage is 0 or if you omit nCodePage, a code page isn't selected when the Code Page dialog box is displayed.
- cText (Optional)
- Type: Usual
Specifies the text displayed in the Code Page dialog box. If you omit cText, X# displays the following text:
"Please select a code page for cross-platform data sharing."
- cDialogTitle (Optional)
- Type: Usual
Specifies the title that appears in the Code Page dialog box title bar. If you omit cDialogTitle, the title "Code Page" is displayed.
Return Value
Type:
Usual
Numeric
Remarks
GetCp( ) returns 0 if you exit the Code Page dialog box by pressing Esc, choosing the Cancel button, or choosing Close from the Control menu.
The code pages listed in the Code Page dialog box are determined by Foxpro.INT, the X# International code page support file.
You can include GetCp( ) in commands such as MODIFY COMMAND, Append From, and COPY TO that support the AS nCodePage clause.
The Code Page dialog box is displayed, making it possible for you to specify the code page of the file opened, appended, or created.
Because no code page 0 exists, you must trap for 0 in case the user chooses Esc, the Cancel button, or Close from the Control menu.
Examples 1? GetCp(1252, "Select a Code Page", "Code Page Selection")
See Also