Community Syntax Highlighter - Community News and Feedback - Site Root - Progress Community
 Community News and Feedback

Community Syntax Highlighter

  • When creating your new forum post, click the highlighter icon:

    A pop-up window will open up where you can then select the language you're about to add in your post... 

    Once you have selected the language then copy/past your code. In this example I used Perl

    Click insert to add the code in your post. 

    Continue writing your new post. Be aware that in edit mode, the post editor will not show code highlights... 

    Save your post that will then be displayed with the appropriate highlighting.

  • During 2014, we will look into eventually adding ABL to this plugin.

  • Is there one of the existing you recommend for posting ABL ... since 99% of the likely code will be ABL?

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • Unfortunately the plugin we use has not ABL part of the dev languages OOTB... We will try to add it, if possible.

  • Right, but a recommendation on some other language which is the best shot in the meantime would be helpful.

    Consulting in Model-Based Development, Transformation, and Object-Oriented Best Practice  http://www.cintegrity.com

  • Hi all,

    Today we just released the 4GL code highlighter. So when you are inserting code, pick "Progress"

    Your ABL code will then be colored.

    @ thanks for the example. 

    DEFINE VARIABLE myObj   AS JsonObject NO-UNDO.
    DEFINE VARIABLE myElem  AS JsonObject NO-UNDO.
    DEFINE VARIABLE myArray AS JsonArray NO-UNDO.
    DEFINE VARIABLE myLongchar AS LONGCHAR NO-UNDO.
    DEFINE VARIABLE lv_Property  AS CHARACTER EXTENT no-undo.
    DEFINE VARIABLE lv_Property1 AS CHARACTER EXTENT no-undo.
    DEFINE VARIABLE lv_i  AS INTEGER NO-UNDO.
    DEFINE VARIABLE lv_i2 AS INTEGER NO-UNDO.
    DEFINE TEMP-TABLE ttCust
     FIELD CustNum     AS INTEGER
     FIELD Name        AS CHARACTER  
     FIELD CreditLimit AS DECIMAL
     FIELD someLogic   AS LOGICAL .
    
    /* . . Load temp-table . */
    FOR EACH Customer WHERE CustNum < 5 NO-LOCK:
      CREATE ttCust.
      BUFFER-COPY Customer to ttCust.
    END.
    
    /* Let's create json object.. */
    myObj = NEW JsonObject().
    
    /* ..and load it with ttCust data  */
    myObj:Read(TEMP-TABLE ttCust:HANDLE).
    
    /* we can get names of all properties within json object */
    lv_Property = myObj:GetNames().
    
    /* Here you get message "ttCust" as this json object contains one element */
    /* and that is JsonArray with its elements being ttCust records           */
    MESSAGE  "Number of elements in root json object is " EXTENT(lv_Property)
       VIEW-AS ALERT-BOX INFO BUTTONS OK.
    
    /* Let's write our json to a file so that we can examine it's structure */
    myObj:WRITEfile("ttCust.txt") .
    
    /* so let's fetch our array from myObj's array property) */
    myArray = myObj:GetJsonArray("ttCust") .
    
    /* and let's report on it's length */
    MESSAGE "Array's length is " myArray:Length
       VIEW-AS ALERT-BOX INFO BUTTONS OK.
    
    /* Let's go through the json array elements */
    DO lv_i = 1 TO myArray:Length :
      myElem = myArray:GetJsonObject(lv_i) .
      lv_Property1 = myElem:GetNames().
      DO lv_i2 = 1 TO EXTENT(lv_Property1) :
          MESSAGE "Property " lv_Property1[lv_i2] " has type : " myElem:GetType(lv_Property1[lv_i2])
               VIEW-AS ALERT-BOX INFO BUTTONS OK.
      END.
    END.
    
    /* For other data types please check            */
    /* Progress.Json.ObjectModel.JsonDataType class */
    /*    Array property                            */
    /*    String property                           */
    /*    Number property                           */
    /*    Boolean property                          */
    /*    Object property                           */
    /*    Null property                             */
  • Could it be renamed to ABL, since that's the name of the language? That way it would also be higher up the list

  • It will be renamed to ABL within the next few days. We are also adding more keywords to the brush.

  • Hi all,

    The Syntax Highlighter has been improved and renamed to ABL.

    It's now the first choice in the drop down list.

  • Can this highlighter be made available to use on intranet sites ?

  • Hi Carl,

    We used github.com/.../syntaxhighlighter and added our ABL brush. I have asked our team to provide me the brush files. As soon as I'll get these I'll share them through this thread.

  • Brush files progress syntax new.zip