Page 1 of 1

Error when trying to use a imported .net class.

Posted: Fri Apr 27, 2012 4:28 pm
by timmeh
I've used the import wizard in Jade to import the .net 'regex' class from System.dll
I'm using Jade 6.3.05 and I've written a small JadeScript to test the imported regex class

Code: Select all

vars regex : Regex; begin create regex transient; epilog delete regex; end;
Although once i execute this I get the following errors:

Code: Select all

Type: System Exception Error Code: 1008 Entry point not in library Source: delete regex;
and following prompt:

Code: Select all

jade.exe - Entry Point Not Found The procedure entry point ??0DllDesc@@QAE@QB_W_N@Z could not be located in the dynamic link library JOMOS.dll. OK
Anyone run into this before or know what I'm doing wrong? This is the first time I've imported anything from .net

Re: Error when trying to use a imported .net class.

Posted: Sat Jun 02, 2012 3:57 am
by Dr Danyo
I just tried using it under JADE 6.3.08 and it worked a treat, here is my workspace to validate email addresses.

vars
regex : Regex_1; //renamed to Regex_1 due to a class name conflict (I called my schema Regex so the .net class clashed with the app name).
pattern : StringUtf8;
begin
pattern := @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
& @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
[0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
& @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
& @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$";

create regex transient;
regex.createDotNetObject_1(pattern);

write regex.isMatch_2(@"drdanyo@awesome.com");
write regex.isMatch_2(@"drdanyo");

delete regex;
end;

Re: Error when trying to use a imported .net class.

Posted: Thu Jun 14, 2012 2:47 pm
by timmeh
Awesome,

my Jade version was outdated, and also wasnt using .createDotNetObject_1 method correctly, thanks for clarifying. all working now!