fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: typed codeblocks in predicates

typed codeblocks in predicates 30 Sep 2019 10:43 #10966

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2232
  • Hi,

    using the X# runtime and VO dialect, I have thiscode:
    using System.Collections.Generic
    
    class SyntaxCmpletion
    protect _oList as List<Exception>
    
    constructor()
       _oList := List<Exception>{}
       return
    
    method CheckSyntax( cMessage as string ) as Exception
       local oResult			as Exception
    
       oResult := _oList:Find( {| o as Exception | o:Message == cMessage } )
    
      return oResult
    end class

    Should that compile?
    Using the C# syntax it compiles:
    oResult := _oList:Find( { o as Exception => o:Message == cMessage } )

    With the codeblock syntax the compiler gives the following message:
    error XS9057: Typed parameters in codeblocks are not supported by the (Vulcan) runtime.
    even if I use the X# runtime.

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    typed codeblocks in predicates 30 Sep 2019 12:25 #10967

  • robert's Avatar

  • robert


  • Posts: 1690
  • Wolfgang
    For now you have to use the Lambda expression syntax in these cases.
    Typed codeblocks are on our todo list.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    typed codeblocks in predicates 30 Sep 2019 13:43 #10970

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2232
  • Hi Robert,

    that is ok - wasn't sure if it was an error or a todo. Therefore I preferred to aks before adding a ticket (and this was an issue I've encountered several times before in other occasions).
    The important thing for me is that I have a way to go forward (and I have that).

    Wolfgang
    P.S. I'm currently working on a production capacity planning system in 100% X# and WPF, but most of the data comes from a DBF based VO application
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1