Dynamics Ax X++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AxDude
    New User
    • Feb 2018
    • 2

    Dynamics Ax X++

    Hi

    I was wondering if there is anything available which will allow Beyond compare to recognise the structure and/or syntax of Dynamics Ax .xpo files?

    I've used Beyond Compare with Ax xpo files for some time now but it doesn't colourise the text or recognise any of the tags which indicate the different types of objects within the file (tables, classes, methods, EDTs, enums, etc.)
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    We don't have this format included by default or as an additional website download:
    http://www.scootersoftware.com/downl..._moreformatsv4

    You can use the Tools menu -> File Formats dialog to create a new format associated with this file extension. You can then define Grammar elements. If these elements use the same names as other formats, they will share that coloring. The coloring is defined for each grammar element name in the Tools menu -> Options dialog, Colors/Fonts tab, File views tab.

    We have a KB article on defining grammar elements (and controlling if they are Important or Unimportant) here:
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment

    • AxDude
      New User
      • Feb 2018
      • 2

      #3
      Hi there

      Thanks for your help Aaron, I've done that and have an X++ file format and grammar elements defined, changed the default colours for the different file display elements to match Ax. X++ is based on Java so I've copied in the keywords and operators from MSDN, for the rest I just copied the grammar elements from Java

      This works for the code sections but an .xpo file can also define properties for an object as well as methods, so I'd like to be able to define grammar elements for all the other text as well but I can't see how to do this in Beyond Compare

      Here's an example, everything from the tag METHODS to ENDMETHODS displays correctly but I would like to define grammar elements for all the other text as well (if it's possible)

      Code:
      Exportfile for AOT version 1.0 or later
      Formatversion: 1
      
      ***Element: DBT
      
      ; Microsoft Dynamics AX Table : Currency unloaded
      ; --------------------------------------------------------------------------------
        TABLEVERSION 1
        
        TABLE #Currency
          EnforceFKRelation 0
          PROPERTIES
            Name                #Currency
            Label               #@SYS14968
            FormRef             #Currency
            TitleField1         #CurrencyCode
            TitleField2         #Txt
            TableContents       #Default data
            SecurityKey         #LedgerTables
            CacheLookup         #EntireTable
            CreateRecIdIndex    #Yes
            SaveDataPerCompany  #No
            TableGroup          #Group
            PrimaryIndex        #CurrencyCodeIdx
            ClusterIndex        #CurrencyCodeIdx
            ModifiedDateTime    #Yes
            DeveloperDocumentation  #@SYS125045
            Origin              #{2C08002F-0000-1000-4375-7272656E6379}
            LegacyId            #47
          ENDPROPERTIES
          
          FIELDS
            FIELD #CurrencyCode
              STRING
              PROPERTIES
                Name                #CurrencyCode
                HelpText            #@SYS2907
                Mandatory           #Yes
                AllowEdit           #No
                Table               #Currency
                Origin              #{B05DEDB2-7419-4193-9B17-88860D9E3824}
                LegacyId            #1
                ExtendedDataType    #CurrencyCode
                StringSize          #3
              ENDPROPERTIES
              
            FIELD #Txt
              STRING
              PROPERTIES
                Name                #Txt
                HelpText            #@SYS2908
                Table               #Currency
                Origin              #{7BDF6048-09C9-4FA6-94C7-F53AAFFA508E}
                LegacyId            #2
                ExtendedDataType    #CurrencyName
                StringSize          #60
              ENDPROPERTIES
              
          ENDFIELDS
          GROUPS
            GROUP #Example
              PROPERTIES
                Name                #Example
                Label               #@SYS1234
              ENDPROPERTIES
              
              GROUPFIELDS
                #LegacyCurrency
                #Active
                #RateTolerance
              ENDGROUPFIELDS
            ENDGROUP
          ENDGROUPS
          
          INDICES
            #CurrencyHubIdx
            PROPERTIES
              Name                #CurrencyIdx
              AllowDuplicates     #No
              Origin              #{A1C317D0-13E0-412B-965E-20EC52C08DA0}
            ENDPROPERTIES
            
          ENDINDICES
          FULLTEXTINDICES
          ENDFULLTEXTINDICES
          REFERENCES
          ENDREFERENCES
          
          DELETEACTIONS
            #InventTable(Currency)
            PROPERTIES
              Table               #InventTable
              DeleteAction        #Restricted
              Relation            #Currency
            ENDPROPERTIES   
            
          ENDDELETEACTIONS
          
          METHODS
            SOURCE #initValue
              #public void initValue()
              #{
              #    super();
              #}
            ENDSOURCE
            SOURCE #currencyCodeISO
              #/// <summary>
              #/// Returns currency code
              #/// </summary>
              #/// <param name="_currencyCode">
              #/// Specify currency code as parameter
              #/// </param>
              #/// <returns>
              #/// Returns currency code
              #/// </returns>
              #/// <remarks>
              #/// Returns currency code
              #/// </remarks>
              #
              #public static CurrencyCodeISO currencyCodeISO(CurrencyCode _currencyCode)
              #{
              #    Currency    currency;
              #    ;
              #
              #    select firstonly CurrencyCodeISO from currency
              #        where currency.CurrencyCode == _currencyCode;
              #
              #    return currency.CurrencyCodeISO? currency.CurrencyCodeISO : _currencyCode;
              #}
            ENDSOURCE
          ENDMETHODS
        ENDTABLE
        
      
      ***Element: END

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15997

        #4
        Hello,

        BC4 does not have grammars within of grammars, so if one element is swallowing another definition, then it will be the parent definition.

        If you click into the text, the bottom status bar will show the detected grammar element. What element is currently detected in your text, and what definition are you trying to match on?
        Aaron P Scooter Software

        Comment

        Working...