xsharp.eu • Foxpro compatibility list - Page 4
Page 4 of 5

Foxpro compatibility list

Posted: Fri Oct 18, 2019 3:34 pm
by FoxProMatt
Yes, sir... I joined FOX almost immediately once I learned of X# simply for the reason of showing my support for them from a VFP community member. I hope others will too. Maybe SWFox will net them some more paying support. Wish there could be a corporate sponsor but now sure what the incentive would be for them, other than simply charity.

Foxpro compatibility list

Posted: Sat Oct 19, 2019 5:56 am
by wriedmann
Hello all,
let me add something: I'm not a VFP programmer, but coming from Clipper and VO.
And I have been jumped on the X# train and delivered X# built apps to my customers long before the VO support was ready.
You should not see X# only as tool to move your existing code to .NET, but see it as possibility to use the loved xBase language in new .NET projects, maybe creating webservices or WPF applications or even small utilities.
With X# you can use LinQ and all the goodies of the C# world in a nice xBase language!
Wolfgang

Foxpro compatibility list

Posted: Sun Oct 20, 2019 11:39 pm
by FoxProMatt
Please add SET ORDER, SET RELATION, and SET SKIP to the "Database and Workarea commands" section.

I know there there are many SET XXX commands, but these are really primitive (canonical) VFP things most ppl will want or need early in their evaluation process.

In testing it appears that SET ORDER already works. Just need too update the list to reflect this.

I tested Set Relation, and it does not give a compiler error or runtime erorr, but is *causes* a runtime error when you reference a field in the target table after pointing to it in a Set Relation command.

Here is the code I am tinkering with:

Code: Select all

Using System
Using System.Collections.Generic
Using System.Linq
Using System.Text

Using XSharp.Core
Using XSharp.VFP
Using XSharp.RT
Using XSharp.RDD


#include "dbcmd.xh"

Function Start() As Void Strict
	
	Local oObject = myNS.MyFirstClass{} As MyFirstClass
	Field cType, cKey, cFkey, MoreData
	
	Select 0
	Use (oObject:cDbfName) Alias WA1 Shared
	Set Order To cKey
	
	Local cChildTable = "C:Worklm5AppDataxSharp_Test_Child.dbf"
	Use (cChildTable) Alias WA2 New Shared
	Set Order To cFkey
	
	Select WA1
	Set Relation To cKey Into WA2
		
	Scan For cType = "I"
		? cKey
		? "  " + WA2->MoreData     <<<---- Error happens here...
	Endscan
	
	Wait

End Function




Begin Namespace myNS

	//==============================================================
	Define Public Class MyFirstClass As Custom

		Public cDbfName = "C:Worklm5AppDataxSharp_Test_Parent.dbf"

	End Define

End Namespace


Foxpro compatibility list

Posted: Mon Oct 21, 2019 12:28 am
by lumberjack
Hi Matt,
Matt Slay wrote: Here is the code I am tinkering with:

Code: Select all

		? "  " + WA2->MoreData     <<<---- Error happens here...
Without knowing the data, are you sure there is a child for the master record?
Try put it in an IF statement:

Code: Select all

IF WA2->Found()
  ? " " + WA2->MoreData
ELSE
  ? "No child data for", cKey
ENDIF

Foxpro compatibility list

Posted: Mon Oct 21, 2019 2:01 am
by FoxProMatt
No, for VFP compatibility, the code I showed has to run without error. In this case there is a matching child record, but even if there wasn't, in VFP, the child cursor would get moved to EOF and it would return the empty value for the data type of the referenced child field.

I've attached the DBFs in a zip file.

Plus, this discussion has really taken this topic way off line, and I do apologize for this. I should have made this in a separate thread.

Foxpro compatibility list

Posted: Mon Oct 21, 2019 3:46 am
by lumberjack
Hi Matt,
Matt Slay wrote:No, for VFP compatibility, the code I showed has to run without error. In this case there is a matching child record, but even if there wasn't, in VFP, the child cursor would get moved to EOF and it would return the empty value for the data type of the referenced child field.
Sorry have not yet run on my side, but can you add this to the top of your start method?

Code: Select all

? RddSetDefault()
Need to know what the default DBF driver is. If I remember correctly the VO/Vulcan default was "DBFNTX".

You might need to RddSetDefault("DBFCDX")

Foxpro compatibility list

Posted: Mon Oct 21, 2019 6:45 am
by robert
Johan,

The XSharp.VFP assembly has an Init procedure that sets the default RDD to DBFVFP.

Robert

Foxpro compatibility list

Posted: Mon Oct 21, 2019 7:03 am
by lumberjack
Hi Robert,
Robert van der Hulst wrote: The XSharp.VFP assembly has an Init procedure that sets the default RDD to DBFVFP.
Thanks for the clarification. Was just wondering, will that then AUTO DBFCDX opening a Dbf or should Matt have specified the CDX extension?

Foxpro compatibility list

Posted: Mon Oct 21, 2019 7:13 am
by robert
The Auto opening of CDX files is controlled by the Runtime State, AutoOpen.
See
https://github.com/X-Sharp/XSharpPublic ... x.prg#L387

This setting is TRUE by default:

https://github.com/X-Sharp/XSharpPublic ... te.prg#L51

Robert

Foxpro compatibility list

Posted: Mon Oct 21, 2019 9:35 am
by robert
Jeff,
Jeff Stone wrote:Hi All,
I'm new to this forum but have been a Dbase, Clipper, and then VFP programmer since the early 1980's. As we have clients that are sensitive to our still developing applications in VFP, we have had to show them that we can easily port all of our code to Harbour/HMG. (Please note that our code is light on the use of VFP GUI and reporting features, so this is easier for us than others.) There are discussions on both Harbour and HMG users group forums discussing how to make Harbour easier to transition to for VFP coders. A link one such discussion that may be helpful is here: http://www.hmgforum.com/viewtopic.php?f=6&t=3905

I have also found that members on the boards (especially the HMG board) are very willing to help in the development of enhancements. I suspect that their satisfaction with Harbour/HMG may make members less likely to contribute monetarily here at least in terms of the levels required to become a "Friend of XSharp". (It might be worth considering whether a $100 contribution level might actually generate more contributions than the $1,000/$825 level.)
Thanks for your comments. It is really appreciated,

We have considered making the Friends Of XSharp subscription (much) cheaper, but have decided to keep it at the current level, after listening to our customers, for the following reasons:

- People don't have to pay for X#. There is a free download for everybody

- Our primary audience for the subscription program is "professional developers". For this audience the time invested to migrate their apps costs MUCH more than the cost of the program. And the value of the support they get is also worth the money.

- For people that sympathize with the project but can't afford the whole subscription we have added the option to donate money (see the Donate button on the top of this page). To be honest: not many people have used this possibility.


Robert