Mixing C# and X#

This forum is meant for questions and discussions about the X# language and tools
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Mixing C# and X#

Post by wriedmann »

Hi Andrej,
you can convert your array to a List<object> - and then any member can contain anything, even other lists.
But maybe Robert has a better idea.
Wolfgang
P.S. I would go away from multidimensional arrays and use single dimension arrays of objects - I'm doing such changes also in my VO code whenever I touch older code where I have used multidimensional arrays
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
info@task.si
Posts: 31
Joined: Mon Nov 02, 2015 2:08 pm

Mixing C# and X#

Post by info@task.si »

Thank you Wolfgang, I will follow your advice. Do you think that continuing to use some win32.dll functions (GetProfileString ...) and also using DBF files could lead me in some troubles in ASP.NET Core world ? I am also asking myself with such doubts because I am aware that Blazor code can be used in Linux op.system. I am asking this mainly for server side oriented Web applications.

TIA Andrej
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Mixing C# and X#

Post by wriedmann »

Hi Andrej,
unfortunately I have no experience with .NET Core or ASP.NET or Blazor.
But you should try to not use any Win32 DLL functions if you plan to use your application also on other operating systems like Linux.
AFAIK the X# RDD was written using .NET file read/write functionalities, so is should also work on Linux - but here to have better ask Fabrice if he has tried something (he has shown X# applications on Linux a few times) or Robert if he knows anyone that has tried it.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4269
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Mixing C# and X#

Post by robert »

Andrej,

We have tested the X# runtime on Linux. But I do not know anyone that uses this in production.
Our low level file IO (which is used by the RDDs) uses managed file streams.
When running on windows and in shared mode we are using a special file stream to overcome some problems that the managed streams have (they are buffering too much so the changes made by other users are not visible in time).
In one of the net builds we will be adding buffering to the file streams that are used by the RDD system, but that is all done in managed code so it should run on any platform.
If you want to run outside windows you should avoid calling Win32 calls such as the functions to read/write INI files.
But is is not too difficult to replace that with managed code that reads these files with managed streams.
I am sure that a search on the web will result in many solutions for this. Look for C# and Ini files and you will find what you need.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Mixing C# and X#

Post by FFF »

robert wrote:If you want to run outside windows you should avoid calling Win32 calls such as the functions to read/write INI files.But is is not too difficult to replace that with managed code that reads these files with managed streams.
I am sure that a search on the web will result in many solutions for this. Look for C# and Ini files and you will find what you need.
I use a class for this Johan Nel kindly shared years ago - which is in X#. Maybe he would contribute this. Would be nice, if we could create a community filled "repo" in download, mainly for the bread and butter tools :)
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Mixing C# and X#

Post by wriedmann »

Hi Karl,
Would be nice, if we could create a community filled "repo" in download, mainly for the bread and butter tools
I would do that immediatly. Do you have any idea how to accomplish that? A simple directory or a page with documentation?
Or maybe add it to the Wiki?
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
info@task.si
Posts: 31
Joined: Mon Nov 02, 2015 2:08 pm

Mixing C# and X#

Post by info@task.si »

Thank you to all. As I go deeply my question for function GetProfileString was a product of my lack of knowledge.
GetProfileString is a part of kernel32.dll (Windows 10 and other desktop Windows op. system) so using it in a Web server applications would lead me probably in a runtime errors .

If anybody will be interested I am preparing a "Development notes using X# in Blazor".
Next step theme in researching will be about X# ResourceFile class in a multilingual Blazor app.

Robert and others Dev Team you really did a GREAT JOB !! :cheer:
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Mixing C# and X#

Post by wriedmann »

Hi Andrej,
GetProfileString() works also on Windows servers.
Windows Server is "only" Windows Professional with severel different settings and several added applications.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
lumberjack
Posts: 723
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Mixing C# and X#

Post by lumberjack »

Hi Karl,
FFF wrote: I use a class for this Johan Nel kindly shared years ago - which is in X#. Maybe he would contribute this. Would be nice, if we could create a community filled "repo" in download, mainly for the bread and butter tools :)
Just a bit busy since I moved town a month ago so still busy finding my feet and settling into my new environment. I will gladly share the jhnIniFile class with anybody interested. I have a couple of new features that I want to implement, give me a week or two. In meantime I can share as is.

Regards,
______________________
Johan Nel
Boshof, South Africa
mainhatten
Posts: 200
Joined: Wed Oct 09, 2019 6:51 pm

Mixing C# and X#

Post by mainhatten »

I'd argue for something on Github...
wriedmann wrote:
Would be nice, if we could create a community filled "repo" in download, mainly for the bread and butter tools
I would do that immediatly. Do you have any idea how to accomplish that? A simple directory or a page with documentation?
Or maybe add it to the Wiki?
Post Reply