Transporting VO to XSharp

This forum is meant for questions and discussions about the X# language and tools
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Transporting VO to XSharp

Post by Chris »

HI Leonid,

Now that you mention it, I remember we discussed this in our dev meeting. But I do not remember what we decided about it :). Will let Robert remind us..
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Transporting VO to XSharp

Post by robert »

Leonid,
For out parameters we definitely support the "discard" variable that is just an underscore.
I am not sure , but I think we support that for REF parameters as well.
Just give it a try.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Transporting VO to XSharp

Post by leon-ts »

Robert,

Could you give an example of the syntax of this in XSharp? I could not do it even for OUT. The compiler throws an error:
XS0103 The name '_' does not exist in the current context
I tried several options:

Code: Select all

MyFunc(1, 2, OUT _)
MyFunc(1, 2, OUT STRING _)
MyFunc(1, 2, _)
MyFunc(1, 2, @_)
Best regards,
Leonid
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Transporting VO to XSharp

Post by robert »

Leonid.

MyFunc (1, 2, OUT VAR _ )
MyFunc (1, 2, OUT _ AS STRING)
MyFunc (1, 2, OUT NULL)

// not sure about the following ones
LOCAL _ as STRING
MyFunc (1, 2, REF _ )


See https://github.com/X-Sharp/XSharpDev/bl ... rp.g4#L839 for the formal declaration of different syntaxes

Robert

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Transporting VO to XSharp

Post by leon-ts »

Robert, thanks!
All examples with OUT work fine. REF, as you have shown, also works fine (without warning of an unused variable). If REF still worked with underscore in the same syntax as OUT (without a LOCAL declaration), it would be very fine :)

Best regards,
Leonid
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Transporting VO to XSharp

Post by robert »

Leonid
Can you open an issue for this on GitHub so I won’t forget this?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Transporting VO to XSharp

Post by Chris »

Since Leonid does not have a Git account, I opened it myself: https://github.com/X-Sharp/XSharpPublic/issues/363
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Transporting VO to XSharp

Post by leon-ts »

Hi all!
Happy Easter (Orthodox)!

Some details were clarified, considering which, perhaps, there is no need to do underscore for "REF".
It turns out that in the VODBOrdSetFocus function, the "cOrder" parameter, which returns the previous value, is declared as "OUT".

Code: Select all

XSharp VoDbFunctions.prg
FUNCTION VoDbOrdSetFocus(cIndexFile AS STRING,uOrder AS USUAL,cOrder OUT STRING) AS LOGIC
    RETURN VoDb.OrdSetFocus(cIndexFile,  uOrder, OUT cOrder)
But in the VS 2019 editor, it appears as "REF" (see screenshot in the attachment). This is what confused me. But since this is actually "OUT", where underscore works great, I don’t see the need to modify "REF". Better to improve integration with VS 2019 :)

Best regards,
Leonid
Attachments
screen1.jpg
screen1.jpg (28.18 KiB) Viewed 418 times
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Transporting VO to XSharp

Post by robert »

Leonid,

Confirmed and fixed. I also noticed that the XML comments were not shown for methods/functions with REF or OUT parameters. This has been fixed too.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply