Änderungen in X# 2.18.0.4

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

Post Reply
lagraf
Posts: 452
Joined: Thu Jan 18, 2018 9:03 am
Location: A

Änderungen in X# 2.18.0.4

Post by lagraf »

Hallo,
ich habe mir heute die aktuelle Version von X# installiert und meine Testapps durchcompiliert. Dabei bekomme ich einige Warnings und Fehler gegenüber der alten Version:

SELF:ExecuteCommand(readerName, "00a40804021fff":ToByteArray(), REF response2)
warning XS9071: Parameter 3 needs a(n) 'Out' modifier. This modifier was automatically added
Was muss ich ändern damit die Warning verschwindet?

@@Array.Resize(REF array2, array2:Length + response2:Length - 2)
error XS0176: Member 'System.Array.Copy(System.Array, int, System.Array, int, int)' cannot be accessed with an instance reference; qualify it with a type name instead
Bei den Compiler Errors in der X# Doku steht leider auch nicht mehr dabei.

Und noch eine Frage zu einer ComEnabled DLL:
Wenn ich ein fertiges Com Modul für VO habe und dieses mit einer neuen Compiler Version compiliere, ev. neue Fehler und Warnings ausbessere, muß ich dann die ganze Prozedur zur Erstellung eines Com Moduls wiederholen oder genügt die Compilierung des X' Codes?

LG Franz
User avatar
robert
Posts: 4552
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Änderungen in X# 2.18.0.4

Post by robert »

Franz,

1st)

Code: Select all

SELF:ExecuteCommand(readerName, "00a40804021fff":ToByteArray(), OUT response2)
2nd)

Code: Select all

@@Array.Resize(REF array2, array2:Length + response2:Length - 2)
I think there is a local with the name array in the context of this code.

Try to change it to:

Code: Select all

System.Array.Resize(REF array2, array2:Length + response2:Length - 2)
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
wriedmann
Posts: 3773
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Änderungen in X# 2.18.0.4

Post by wriedmann »

Hallo Franz,
zum COM-Modul: so lange Du nicht die Versionsnummer weitersetzt, ist das für Dein VO-Programm und das System immer dieselbe DLL.
Erst wenn Du die Versionsnummer änderst, musst Du Dein Manifest anpassen.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
lagraf
Posts: 452
Joined: Thu Jan 18, 2018 9:03 am
Location: A

Re: Änderungen in X# 2.18.0.4

Post by lagraf »

Hallo Wolfgang,
danke für die Info! Gibt es eigentlich irgendwo im X# Netz auch eine Doku "Unterschiede X# vs VO"?

Hi Robert,
//SELF:ExecuteCommand(readerName, "00a40804021fff":ToByteArray(), REF response2)
SELF:ExecuteCommand(readerName, "00a40804021fff":ToByteArray(), OUT response2)

Is transfer by reference (REF) obsolete?
ExecuteCommand is defined as
PUBLIC METHOD ExecuteCommand(readerName AS STRING , command AS BYTE[] , response OUT BYTE[] ) AS LOGIC

Should I use IN instead of OUT?

Regards, Franz
User avatar
wriedmann
Posts: 3773
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Änderungen in X# 2.18.0.4

Post by wriedmann »

Hallo Franz,
ich habe das mal probiert zusammenzuschreiben:
https://docs.xsharp.it/doku.php?id=othe ... patibility
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
lagraf
Posts: 452
Joined: Thu Jan 18, 2018 9:03 am
Location: A

Re: Änderungen in X# 2.18.0.4

Post by lagraf »

Danke Wolfgang, ich seh's mir an!
LG Franz
User avatar
robert
Posts: 4552
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Änderungen in X# 2.18.0.4

Post by robert »

Franz,
lagraf wrote: Tue Mar 12, 2024 7:19 am
Hi Robert,
//SELF:ExecuteCommand(readerName, "00a40804021fff":ToByteArray(), REF response2)
SELF:ExecuteCommand(readerName, "00a40804021fff":ToByteArray(), OUT response2)

Is transfer by reference (REF) obsolete?
ExecuteCommand is defined as
PUBLIC METHOD ExecuteCommand(readerName AS STRING , command AS BYTE[] , response OUT BYTE[] ) AS LOGIC

Should I use IN instead of OUT?
REF means that the variable must have a value before the call. It may be changed (by ExecuteCommand in this case)
OUT means that the variable does not have to be initialized. It must be changed inside ExecuteCommand.
IN means that the variable must be initialized and may NOT be changed. It acts like REF (so it passes the value by reference) but the reference is read only.
IN is usefull in scenarios where the variable is of a large valuetype (like a struct). Instead of copying the complete structure, the compiler can pass a pointer to the structure. That could make the code a little bit faster.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
lagraf
Posts: 452
Joined: Thu Jan 18, 2018 9:03 am
Location: A

Re: Änderungen in X# 2.18.0.4

Post by lagraf »

Hi Robert,
thanks for info!
Regards, Franz
Post Reply