xsharp.eu • Mixing C# and X# - Page 2
Page 2 of 2

Mixing C# and X#

Posted: Fri Oct 02, 2020 2:54 pm
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

Mixing C# and X#

Posted: Sat Oct 03, 2020 6:05 am
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

Mixing C# and X#

Posted: Sat Oct 03, 2020 8:48 am
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

Mixing C# and X#

Posted: Sat Oct 03, 2020 9:23 am
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

Mixing C# and X#

Posted: Sat Oct 03, 2020 9:48 am
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 :)

Mixing C# and X#

Posted: Sat Oct 03, 2020 9:51 am
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

Mixing C# and X#

Posted: Sat Oct 03, 2020 12:45 pm
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:

Mixing C# and X#

Posted: Sun Oct 04, 2020 9:18 am
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

Mixing C# and X#

Posted: Thu Oct 15, 2020 8:33 am
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,

Mixing C# and X#

Posted: Wed Nov 18, 2020 4:58 pm
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?