Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Re: Testing external function GreatFunction
Wed, Aug 12 2015 4:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Peter

>Question 1 : How do I get the DLL size smaller than 3.4 MB?

At a quick glance I can't see why, but as Tim says use the latest templates and select the lightweight version. My external functions weighs in at 772k and its doing a lot more than yours. Also as Tim hints its probably the compiler - are you producing the dll using a debug configuration? (not I use D2006 so I have no idea what the latest IDEs do apart from what I read on Embarcadero ngs)


>Question 5 : What steps do I have to take to get all the pieces of
>GreatFunction to work?

Having been through this loop:

stage 1: make sure you function does what you think it will do. This sounds trivial but isn't, and its the most likely place for things to go wrong. In my case, especially for the word generators and text convertors I set up a test bed to check things out. Its not to difficult since your function is fed a couple of parameters and returns a float.

once that's working and working correctly

stage 2: create the dll, add the module & function into your database and test it in situ

From your comments,

/* The following should return every row. It returns no rows.
SELECT *
FROM GSName
WHERE GreatFunction(Surname, Given) <> 2
*/


/* In development the following showed that results were Null
SELECT
  GreatFunction('ABC', 'ABC') IS NULL
FROM GSName
*/

if it weren't for the fact that the function is so trivial I'd say  "I don't think you've passed stage 1 yet" SmileyThe attached does work - just use it in place of your .dpr Using D2006 iit generates a dll < 250k. You can just hook your function into it.

I think your main problem was choosing the start point you did. If you'd picked one of the new templates it would have probably been easier. eg .AsFloat didn't work and I had to use .AsDouble. Actually, unless you need a float as the output I'd suggest using integers.

I'd also recommend LowerCase ing the function name before you test it - I'm not sure what will happen if someone type lower case / upper case/ inappropriate capitalisation when its called so I remove any doubt.

Roy Lambert






Attachments: lightextmodule.dpr
Image