Writing a routine to compile Progress .cls

Posted by saquib on 15-Nov-2012 08:03

Hi,

I'm trying to write a compile procedure to allow a customer to compile source code that we send them.

The compile procedure part looks like this:


PROCEDURE CompileDir:

  DEFINE INPUT PARAMETER icInputStubPath   AS CHARACTER NO-UNDO.
  DEFINE INPUT PARAMETER icOutputStubPath  AS CHARACTER NO-UNDO.
       
  DEFINE VARIABLE lcFile AS CHARACTER FORMAT "x(60)" EXTENT 3.

  INPUT FROM OS-DIR(lcSourcePath + icInputStubPath).
 
  REPEAT:

    IMPORT lcFile. 
    IF lcFile[3] = "F" AND (lcFile[2] MATCHES "*~.p" OR lcFile[2] MATCHES "*~.w" OR lcFile[2] MATCHES "*~.cls") THEN

    DO:

      DISPLAY lcFile[2].
      COMPILE VALUE(lcFile[2]) SAVE NO-ERROR.
      DISPLAY COMPILER:ERROR FORMAT "Error/Compiled" LABEL "Status".
      IF COMPILER:ERROR THEN
      DO:
        OUTPUT TO VALUE(lcSourcePath + "compile.txt") APPEND.
        MESSAGE "Compilation error in" COMPILER:FILENAME "at line" COMPILER:ERROR-ROW "column" COMPILER:ERROR-COL.
        DO liCount = 1 TO ERROR-STATUS:NUM-MESSAGES:
            MESSAGE "  ~"" + ERROR-STATUS:GET-MESSAGE(liCount) + "~"".
        END.
        OUTPUT CLOSE.
      END.
    END.

  END.

END PROCEDURE.

This works fine for .p and .w but does not work for .cls files. The errors I'm getting look like this one;

Compilation error in .....\ProductAvailabiltyDefs.i at line 24 column 66
  "Invalid datatype specified: Infragistics.Win.Misc.UltraGroupBox. Specify a datatype such as 'character' or the name of a class. (5638)"

  "** ......\ProductAvailabiltyDefs.i Could not understand line 24. (196)"

I get the same error when compiling through roundtable but not when compiling via the roundtable plugin in Eclipse.

Anyone know what the problem is>

Many thanks,

Saquib.

All Replies

Posted by Wouter Dupré on 15-Nov-2012 08:08

Hi,

Thank you for your email. I'm out of the office travelling for business. I will return on November 19. During my absence I will have no/limited access to email and phone. For urgent matters, please call our office, or contact Jiri De Jagere (jdejager@progress.com).

Kind regards,

Wouter

--

Wouter Dupré

Senior Solutions Consultant

Progress Software NV

A. Stocletlaan 202 B | B-2570 Duffel | Belgium

Office +32 (0) 15 30 77 46 | Mobile +32 (0) 478 50 00 49

Posted by kopfb on 15-Nov-2012 08:21

We experienced the a similar issue when first trying to compile .cls files and the fix for us was to add  -assemblies path-to-assemblies in the start of the compile program.

Posted by saquib on 19-Nov-2012 02:52

I added the -assemblies param to my start up params and placed the assemblies.xml file in the -assemblies path and the compile now works.

My next question is, when our customer does their own compile with the script we are writing I'm guessing I'll have to also supply them with the assemblies.xml file but what does this file do?

Does it reference.NET assemblies on my machine (C:\windows\assembly) and if so, then I assume our customer will need these as well?

Many thanks,

Saquib.

Posted by gdb390 on 27-Nov-2012 05:08

From the Progress Help ...

Use Assemblies (-assemblies) to specify the path to the directory containing  the Assembly References File (assemblies.xml) and  any third-party assemblies. By default, these files are expected to be in the  current working directory of the ABL session. If you specify an invalid  directory, the AVM raises an error at startup and halts.
Operating system
and  syntax

Windows
-assemblies assemblies-path
Use
with
Single‑user default
Multi‑user default
The absolute or relative path to the  directory containing assemblies.xml and any  third-party assemblies. A relative path is relative to the working directory for  the OpenEdge session.
ABL applications using the OpenEdge GUI for  .NET must have an assemblies.xml file. If the  -assemblies directory does not contain the file, the AVM  raises an error at startup and halts. If you do not specify -assemblies and the current working directory does not contain  the file, the AVM starts but code that accesses .NET objects generates errors at  compile and run time.
If you specify -assemblies and the client machine does not have an  appropriate version of the .NET framework installed, OpenEdge raises an error  and shuts down.

This thread is closed