You are welcome to participate in the XSharp newsgroups and forum.

When posting to the newsgroups and forums we ask you kindly to follow the rules that you can find here: https://www.xsharp.info/faq/39-xsharp-news-server-rules

Simple question about arrays

More
3 months 1 week ago #1 by Jacek
Jacek created the topic: Simple question about arrays
How can I define table of 256 bytes.

In C# I can write:

Byte[] data = new Byte[256];

In X#:

Local data as Byte[]
data := ?

Jacek

Please Log in to join the conversation.

More
3 months 1 week ago #2 by Robert van der Hulst
Robert van der Hulst replied the topic: Simple question about arrays
Jacek,

In general you can change the C# code

new <type>(params)

to X# :

<type>{params}

so:

data := BYTE[]{256}

Robert

XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in to join the conversation.

More
3 months 1 week ago #3 by Wolfgang Riedmann
Wolfgang Riedmann replied the topic: Simple question about arrays
Hi Jacek,

you can find this answer also here:

https://docs.xsharp.it/doku.php?id=net_array

Wolfgang

Please Log in to join the conversation.

More
3 months 1 week ago #4 by Otto Christiaanse
Otto Christiaanse replied the topic: Simple question about arrays
Hi Wolfgang,

Nice article. Maybe you should mention also that the old VO arrays use USUALs and makes the performance lower than that of typed .NET arrays.
And that at compile time you lack the checks of the compiler.

Regards,
Otto

Please Log in to join the conversation.

More
3 months 1 week ago #5 by Wolfgang Riedmann
Wolfgang Riedmann replied the topic: Simple question about arrays
Hi Otto,

thank you very much! I will add that today.

This documentation should be a community effort, and suggestions like yours help to make it better.

And of course we welcome everyone that is willing to contribute!

Wolfgang

Please Log in to join the conversation.