Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread External function parameters
Mon, Oct 20 2008 2:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

I'm developing an external function in Delphi. In EDBManager I can set a parameter to be of type BLOB which is what I want. What do I use for the parameter of the external Delphi function?

Roy Lambert
Mon, Oct 20 2008 3:12 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I'm developing an external function in Delphi. In EDBManager I can set a
parameter to be of type BLOB which is what I want. What do I use for the
parameter of the external Delphi function? >>

Do you mean when you retrieve the value via the TParam.As* properties ?  If
so, then you would use the AsBlob property in the external function.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Oct 21 2008 4:30 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>Do you mean when you retrieve the value via the TParam.As* properties ? If
>so, then you would use the AsBlob property in the external function.

That and the actual function itself

From what you said I'd have

procedure TEDBExternalModule1.EDBExternalModuleRoutine(const RoutineName: string);
var
ckn: string;
begin
ckn := LowerCase(RoutineName);
....
....
else if ckn = 'cvsearch' then CVSearch(Params.FindParam('docType').AsString, Params.FindParam('FldStr').AsBlob, Params.FindParam('TstStr').AsString, Params.FindParam('CompStr').AsString, Params.FindParam('CI').AsString);
end

and

function CVSearch(const docType:string; FldStr:TBlobField, TstStr, CompStr, CI: string): boolean;

Is that right?

Roy Lambert
Tue, Oct 21 2008 8:35 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< function CVSearch(const docType:string; FldStr:TBlobField, TstStr,
CompStr, CI: string): boolean; >>

Actually, the second parameter should be declared as:

FldStr, (without the TBlobField)

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Oct 21 2008 10:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< function CVSearch(const docType:string; FldStr:TBlobField, TstStr,
>CompStr, CI: string): boolean; >>
>
>Actually, the second parameter should be declared as:
>
>FldStr, (without the TBlobField)

Errm. I know I forgot to change the comma to a semicolon but are you saying that I use TParam(..).AsBlob and string? If so is that any better than using .AsString and string?

Roy Lambert
Tue, Oct 21 2008 5:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Errm. I know I forgot to change the comma to a semicolon but are you
saying that I use TParam(..).AsBlob and string? >>

The TParam objects use AnsiStrings for storing BLOB data (not my choice, but
that's what they use).  There's no problem with doing so - they can include
NULLs, etc.

<< If so is that any better than using .AsString and string? >>

There's really no difference, but I would stick with AsBlob as a
self-documenting mechanism.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Oct 22 2008 2:17 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

Thanks, at least I now have a vague idea what I'm doing.


Roy Lambert
Image