Skip to content

Make CursorAdapter.DataSource accept non-string values in XSharp.VFP.UI - #2169

Merged
RobertvanderHulst merged 1 commit into
X-Sharp:mainfrom
jay23606:pr-go/1558-vfpxporter-cursoradapter-datasource-type
Nov 11, 2026
Merged

RobertvanderHulst merged 1 commit into
X-Sharp:mainfrom
jay23606:pr-go/1558-vfpxporter-cursoradapter-datasource-type

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Bug

CursorAdapter.DataSource in XSharp.VFP.UI was declared AS STRING. A VFP handle assigned as a number (CursorAdapter.DataSource = 1) therefore fails to compile. XSharp.VFP and XSharp.Data declare the same property as Object, so the UI class was the outlier.

Change

  • src/Runtime/XSharp.VFP.UI/Generated/CursorAdapter.generated.prg: PROPERTY DataSource AS STRING AUTO becomes AS OBJECT AUTO.
  • src/Tests/CursorAdapterTests/CheckDataSourceType.py: the regression check asserts the declared type is OBJECT.

The only in-repo caller, src/Tests/CursorAdapterTests/Program.prg, assigns a handle and reads the value back, so the type change does not affect it.

Testing

  • python src/Tests/CursorAdapterTests/CheckDataSourceType.py passes on the fixed file (PASS: DataSource is declared AS OBJECT).
  • The same command fails on the parent commit's file (FAIL: DataSource must be declared AS OBJECT, found AS STRING).

Not verified: the compiler and XSharp.VFP.UI were not built, so the build error is not reproduced here. The check is text-based and does not compile anything.

Open item

Generated/CursorAdapter.generated.prg is produced by a generator that is not in this repository. Regenerating the file will revert this change unless the generator is updated too.

Regression test: fails on base (/DataSource must be declared AS OBJECT/), passes on fix (python src/Tests/CursorAdapterTests/CheckDataSourceType.py)

Fixes #1558

@RobertvanderHulst
RobertvanderHulst merged commit d1df5b5 into X-Sharp:main Nov 11, 2026
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.

[VFPXPorter]CursorAdapter.DataSource type error in XSharp.VFP.UI

2 participants