Subject | Re: [firebird-support] Re: udf firebird delphi |
---|---|
Author | Marc Collin |
Post date | 2004-03-31T19:32:59Z |
Martijn Tonies wrote:
work under delphi and not udf...
> Try this one:i used that before... but the other is faster... don't know why that
>
> procedure MixString(Incoming: PChar);
> var OutStr, IncomingStr: string;
> i, j: Integer;
> begin
> IncomingStr := StrPas(Incoming);
> OutStr := '';
> while Length(IncomingStr) > 0
> do begin
> i := Random(Length(IncomingStr) - 1) + 1;
> // we select a random position in an ever becoming smaller string
> OutStr := OutStr + IncomingStr[i];
> // and copy the character at the selected position to our output string
> // without overwriting other characters
> Delete(IncomingStr, i, 1);
> end;
> StrPCopy(Incoming, OutStr);
> end
>
>
>
> It might not be particular fast on largish strings though...
work under delphi and not udf...
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
> Server.
> Upscene Productions
> http://www.upscene.com