0

I am trying to make use of the .NET assembly, System.Text.RegularExpressions within our business applications to make validation less of a burden. I have tried adding the assembly using using the OpenEdge Architect "Assembly References" option but it is refusing to comply

The assembly is not stored within the windows/assembly (GAC) folder, I can locate it by selecting the Local Assemblies tab and navigating to Windows\Microsoft.NET\assembly\GAC_MSIL however when I try to add the dll I get the following error "Not a valid assembly"

I know that the assembly is not corrupt because I have been using it when developing C#.NET applications I have also come across this article which demonstrates System.Text.RegularExpressions used within ABL. If anyone is able to offer any suggestions which would enable me to get this working I would be extremely grateful.

Thanks in advance

Gary Green
  • 87
  • 2
  • 9

2 Answers2

0

Probably just a long shot but worth telling you about it, two issues for not a valid assembly 64 bit or dynamic serialization.

pedromarce
  • 5,651
  • 2
  • 27
  • 27
0

The following showed up in this morning's PANS e-mail from Progress:

http://knowledgebase.progress.com/articles/Article/000039027?popup=true

The following example shows how to use regular expressions within ABL:

 /*
  * IN TESTING, THIS DOESN'T WORK WITH MY INSTALLATION OF VERSION 10.2B RHEL 6,
  * BUT IT DOES WORK WITH VERSION 10.2B WINDOWS INSTALLATION
  *
  * THE ERROR RETURNED ON THE LINUX ENVIRONMENT IS:
  * │Could not find class or interface Regex. (12886)
  */

USING System.Text.RegularExpressions.*. 
DEFINE VARIABLE chaine AS CHARACTER NO-UNDO INIT "test@test.com". 
DEFINE VARIABLE i AS INTEGER NO-UNDO. 
DEFINE VARIABLE regexp AS CLASS Regex NO-UNDO. 

regexp = NEW Regex("^[^\x00-\x1F^\(^\)^\<^\>^\@^\,^\;^\:^\\^\~"^\.^\[^\]^\s]+(\.[^\x00-\x1F^\(^\)^\<^\>^\@^\,^\;^\:^\\^\~"^\.^\[^\]^\s]+)*@([^\x00-\x1F^\(^\)^\<^\> ^\@^\,^\;^\:^\\^\~"^\.^\[^\]^\s]+(\.[^\x00-\x1F^\(^\)^\<^\>^\@^\,^\;^\:^\\^\~"^\.^\[^\]^\s]+))+$"). 

DO i = 1 TO 100: 
IF regexp:IsMatch(chaine) THEN MESSAGE "OK". 
ELSE MESSAGE "KO" . 
END. 
DELETE OBJECT regexp.

The code example above is specifically for Windows. To use regular expressions with UNIX (or Linux) you need to work with the appropriate libraries for that OS. An example can be found here:

http://dbappraise.com/ppt/shlib.pptx

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
  • Oops, I see that is the same article that you referenced. Sorry. So what doesn't work? – Tom Bascom Mar 26 '13 at 14:50
  • The issue I am having is including the assembly to enable progress to access the .NET namespace. When I try to add the assembly through OE Architect I get the "Not a valid assembly" message. – Gary Green Mar 27 '13 at 09:07
  • I wouldn't think that you need to do anything at all to add the assembly. It seems like it should already be there. Maybe you messed it up somewhere along the way? – Tom Bascom Mar 28 '13 at 14:56