Subject | Re: [firebird-support] UDF Problem |
---|---|
Author | Robert Tulloch |
Post date | 2004-01-10T19:37:50Z |
Hi:
Robert Tulloch wrote:
library strudf;
uses
SysUtils;
function fn_ProperCaseString(var szSource, szResult : PChar): PChar;
cdecl; export;
var
i : integer;
len : integer;
begin
result := szResult;
if strlen(szSource) = 0 then
begin
szResult^ := #0;
exit;
end;
len := strlen(szSource);
i := 0;
szSource[i] := UpCase(szSource[i]); {Catch the first letter and
uppercase it}
while (i < len) do
begin
szResult^ := szSource^;
while (szResult[i] <> ' ') and (i < Len) do
begin
inc(i);
inc(szResult);
szResult^ := szSource^;
end;
inc(i);
inc(szResult);
szSource[i] := UpCase(szSource[i]); {Catch the next first letter and
uppercase it}
end;
end;
exports
fn_ProperCaseString;
begin
end.
[Non-text portions of this message have been removed]
Robert Tulloch wrote:
>Hi:Tried your suggestions and get same disconnect result!! What do you think?
>
>
>Dimitry Sibiryakov wrote:
>
>
library strudf;
uses
SysUtils;
function fn_ProperCaseString(var szSource, szResult : PChar): PChar;
cdecl; export;
var
i : integer;
len : integer;
begin
result := szResult;
if strlen(szSource) = 0 then
begin
szResult^ := #0;
exit;
end;
len := strlen(szSource);
i := 0;
szSource[i] := UpCase(szSource[i]); {Catch the first letter and
uppercase it}
while (i < len) do
begin
szResult^ := szSource^;
while (szResult[i] <> ' ') and (i < Len) do
begin
inc(i);
inc(szResult);
szResult^ := szSource^;
end;
inc(i);
inc(szResult);
szSource[i] := UpCase(szSource[i]); {Catch the next first letter and
uppercase it}
end;
end;
exports
fn_ProperCaseString;
begin
end.
[Non-text portions of this message have been removed]