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:
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 = "F" AND (lcFile MATCHES "*~.p" OR lcFile MATCHES "*~.w" OR lcFile MATCHES "*~.cls") THEN DO: DISPLAY lcFile. COMPILE VALUE(lcFile) 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.
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>
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 (firstname.lastname@example.org).
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
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.
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?
From the Progress Help ...
Assemblies (-assemblies) startup parameterUse 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 systemand syntaxWindows-assemblies assemblies-pathUsewithMaximum valueMinimum valueSingle‑user defaultMulti‑user defaultClient Session––––assemblies-pathThe 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.