fbpx

C# and XSharp

More
2 years 10 months ago #1 by Horst Korak
C# and XSharp was created by Horst Korak
Hi
First of all, i have no idea about the DotNet world and Compiler technology. I am using VO2.7 and i am happy. When XSharp is handle DBDCDX and i can simply move my code to XHarp i wanna change to X#. Coz VO is going old and afraid one day the OS will not let it run.

I understand that X# is written with C# and i know there is plenty of C# Code outside. So the question is , is it possible to mix this two 'languages' ? So some modules are from C# and some from X# ? So i can call a C# Function from my X# Code like :

cResult := cFunction ('whatever')

Horst

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic C# and XSharp
Hi!

Yes, you can mix as many different languages as you want. Not in the same .exe or .dll file, but from a x# .exe you can use everything that is included in a c# .dll etc and vice versa. Actually, almost all the base .Net Framework classes are written in c#, but can be used of course from every .Net language! Mixing languages is one of the most powerful features of .Net.

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #3 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic C# and XSharp
Hi Horst,

I understand that X# is written with C# and i know there is plenty of C# Code outside. So the question is , is it possible to mix this two 'languages' ? So some modules are from C# and some from X# ? So i can call a C# Function from my X# Code like :


other than what Chris wrote:

you can have a DLL written in C# that defines a class named "Class1" - this DLL can be your own DLL or from another author, with or without sources is indifferent.

In your X# application then you can use the class1 directly:

oObject1 := Class1{}

or you can create a class that inherits from Class1:

class Class2 inherit Class1

and use the new class:

oObject2 := Class2{}

The more you work with .NET, the more you will find samples for your problems in the internet.

And then .NET gives you completely new concepts:

In VO you write

SLen( cString )

in X# you can write

cString:Length

Wolfgang

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #4 by Horst Korak
Replied by Horst Korak on topic C# and XSharp
I will try it with X# . Hope the DBFCDX support and a little SSATutor is soon avaiable.

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #5 by Karl Faller
Replied by Karl Faller on topic C# and XSharp

wriedmann wrote: And then .NET gives you completely new concepts:
In VO you write

SLen( cString )

in X# you can write

cString:Length

Wolfgang

Well, that needs actually ony keystroke MORE ;)- <s,cr>

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #6 by Frank Maraite
Replied by Frank Maraite on topic C# and XSharp

And then .NET gives you completely new concepts:
In VO you write

SLen( cString )

in X# you can write

cString:Length

Wolfgang
Well, that needs actually ony keystroke MORE ;)- <s,cr>


No, type cString:Le and the intellisense does the rest.

By the was, with USING type you can still use the old behaviour of using functions. This you don't need to change your code. Examples will be available later.

Frank

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #7 by Kannan S
Replied by Kannan S on topic C# and XSharp
Hi Guys,

Just want to know if X# is more like C# or like VO and the likes...


Regards

Kannan

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #8 by Wolfgang Riedmann
Replied by Wolfgang Riedmann on topic C# and XSharp
Hi Kannan,

Just want to know if X# is more like C# or like VO and the likes...


I would say: both.

You can write
SLen( cString )
as in VO, and
cString:Length
as in C#.

But the language itself is more VO, as you have if/else/endif, function, method, do case/endcase. X# adds foreach.

The semicolon ";" is a "line continuator" as in VO and Clipper, not a line terminator as in C#, and you don't have to write all these {} as in C#.

The types are specified with "as"
cString as string
and there will be also arrays, codeblocks and usuals as in VO (currently they are'nt implemented). And there are functions (C# don't knows them).

Wolfgang

P.S. if you like to see X# code, look at the samples forum.

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #9 by Kannan S
Replied by Kannan S on topic C# and XSharp
Thank you for the reply.

Since I have not used VO before, except CULE during the Beta days..
I would like to see if I could translate my Clipper/xHarbour project in record time
as I have a version in C#.


Regards

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #10 by Frank Maraite
Replied by Frank Maraite on topic C# and XSharp
Hi Kannan,

i have to convert my clipper apps too this year. Last chance to do that. I want to use most of the code there.

For that I have to to:

- Emulate the TBrowse behaviour as much as possible.
- Design new forms for the READ/GET. Maybe someone is able to do a Facelift (Paul?) for that.

Most of the rest should work with minor changes. The language is very similar.

Frank

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #11 by Kannan S
Replied by Kannan S on topic C# and XSharp
Hi Frank,

Conversion is going to be more interesting and enjoyable than just challenging.
I did just that when I converted from Clipper to xHarbour.
With Cule, I wrote a convertor for forms from resource to .net code which worked for me and need
to check my archives for the code now.

TBrowse....., guess there are other browse functionalities developed for VO and Vulcan that can do most of the work for us. I have moved to DataGridView since.

I would suggest that you redesign all your forms with the designer than just converting from row/col to pixel.

Other big option is WPF when it is ready.

Roslyn is the way forward and there are other possibilities that one would like to explore later and adopt.


Cheers!!!

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #12 by Frank Maraite
Replied by Frank Maraite on topic C# and XSharp
Hi Kannan,

Conversion is going to be more interesting and enjoyable than just challenging.
I did just that when I converted from Clipper to xHarbour.
With Cule, I wrote a convertor for forms from resource to .net code which worked for me and need
to check my archives for the code now.


yes it is.

TBrowse....., guess there are other browse functionalities developed for VO and Vulcan that can do most of the work for us. I have moved to DataGridView since.


I use WPF DataGrid of course directly on DBF. I added special behaviour to TBrowse. Until now I didn't managed to get the same behaviour to DataGrid. Havo to look into somethinge else like DevExpress after the Cologne conference.

Other big option is WPF when it is ready.


WPF is ready(see above)! There is no need to do that producing X# code. Use the build in designer of VS or Expression Blend like I tried. Doing it the right way with full data binding than you have no code behind. Just use the dlls. That's the big pro of .Net: We can freely mix languages and use the best for our needs.

I do WPF by code too, in Vulcan and now in X#. There is nothing that prevents from using it. I want to show a library for that in Cologne.

The work I'm doing now is to eleminate usage of USUALS and ARRAYS. X# shows me now were I used them and does not compile. But this is necessary to use data binding. WPF does not now about ARRAYS for example, even when X# support this. Or better to say: I would expect that. Don't know what kinds of hacks Robert has in mind.

Frank

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #13 by Kannan S
Replied by Kannan S on topic C# and XSharp
Frank,

ROSYLN is a definite step forward...Want to congratulate the guys for the bold step forward..
Wish we could have a comparison for features with samples for most of the needs.

As most have gone for C# and the likes in these years, expect X# to make a big splash real soon, as the next big thing, in the xbase world.

Mixing C# and X# sounds real great. Would like to test this when things are ready for the big roll.

Greetings!!!

Please Log in or Create an account to join the conversation.