Skip to content

Implement GETCP() - #2199

Merged
RobertvanderHulst merged 2 commits into
devfrom
feature/vfp-getcp
Dec 2, 2026
Merged

RobertvanderHulst merged 2 commits into
devfrom
feature/vfp-getcp

Conversation

@Irwin1985

Copy link
Copy Markdown
Contributor

GETCP() was a stub. Now it shows the Code Page dialog, with the platform filter, and returns the code page that was selected, or 0 if the dialog is cancelled.

The list has the code pages that CPCONVERT() supports, so 620 and 895 aren't there, and there's no Help button.

@RobertvanderHulst

RobertvanderHulst commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Why are you excluding 620 and 895?
Is that because these are not supported by .Net?
In that case I would add them to the code, but commented out to explain why they are not included.

@Irwin1985

Copy link
Copy Markdown
Contributor Author

Hi Robert,

Yes, that's the reason. .NET has no encoding for 620 (Mazovia) and 895 (Kamenicky), so CPCONVERT() can't convert them and I left them out of the dialog too.

I've added both commented out with a note, here and in the CPCONVERT() list.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two critical active issues remain: the test provider’s method is not used through interface dispatch, and adding GetCp to the public provider interface breaks existing custom providers.

2 open issues
What changed in this PR

Implements VFP GETCP() with validation, UI-provider routing, a platform-filtered code-page dialog, and headless behavior.

Changes:

  • Added GETCP() provider support and tests.
  • Added Select/Cancel code-page dialog handling.
  • Removed the former stub.
File Description
src/​Runtime/​XSharp.VFP/​UI/​VfpUIService.prg Extends the UI provider contract with code-page retrieval and headless fallback behavior.
src/​Runtime/​XSharp.VFP/​UI/​Dialogs.prg Implements GETCP() argument validation and provider dispatch.
src/​Runtime/​XSharp.VFP/​ToDo-G.prg Removes the obsolete GETCP() stub.
src/​Runtime/​XSharp.VFP.UI/​VfpUIProvider.prg Connects the UI provider to the code-page selection dialog.
src/​Runtime/​XSharp.VFP.UI/​CodePageForm.prg Provides the platform-filtered code-page selection form.
src/​Runtime/​XSharp.VFP.Tests/​GetCpTests.prg Adds tests for argument handling, provider routing, and headless behavior.

Review effort: Lite

@RobertvanderHulst
RobertvanderHulst merged commit c980653 into dev Dec 2, 2026
1 check passed
@RobertvanderHulst
RobertvanderHulst deleted the feature/vfp-getcp branch December 2, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants