Advertisement
6_2008-2009 String Manipulation #200041

MySQLdotNet

MySQL-API for dotNET. I needed a fast connection to mysql for c#, thus I wrote this class(MySQLdotNet). You can get DataSets from Querys and Update them. Also you can send Querys(SQLNonQuery), which do not send data back. SQLScalar returns only one value. 'TestDataAccess' is a little test-client for the API. The source is written in c#, but you can use it with every dotNet-language. To open the project, doubleclick on "\TestDataAccess\TestDataAccess.sln" This Source-code is Freeware. If you modify or update something, that make the program better, please let me know, or send me the sourcecode. Requirement libmysql.dll Today(12-07-2002) I fixed a bug to delete rows from a DataTable (13-07-2002) added flags to DataColumns & primary-keys to the DataTable Enjoy...

AI

Yapay Zeka Özeti: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kaynak Kod
original-source
Upload
unit Functions;
interface
uses
 Windows,Messages, SysUtils, Classes, Graphics,StdCtrls;
function RightTrim(const s:String):String;
function LeftTrim(const s:String):String;
function InStr(Start: integer; Source: string; SourceToFind: string): integer;
function Mid(Source: string; Start: integer; Length: integer): string;
function Left(Source: string; Length: integer): string;
function Right(Source: string; Lengths: integer): string;
function Replace(sData: String; sSubstring: String; sNewsubstring: string): String;
function Split(Source, Deli: string; StringList: TStringList): TStringList;
function Reverse(Line: string): string;
implementation
function Reverse(Line: string): string;
	var i: integer;
	var a: string;
begin
	For i := 1 To Length(Line) do
	begin
	  a := Right(Line, i);
	  Result := Result + Left(a, 1);
	end;
end;
function Split(Source, Deli: string; StringList: TStringList): TStringList;
var
 EndOfCurrentString: byte;
begin
 repeat
  EndOfCurrentString := Pos(Deli, Source);
  if EndOfCurrentString = 0 then
   StringList.add(Source)
  else
   StringList.add(Copy(Source, 1, EndOfCurrentString - 1));
  Source := Copy(Source, EndOfCurrentString + length(Deli), length(Source) - EndOfCurrentString);
 until EndOfCurrentString = 0;
 result := StringList;
end;
function Replace(sData: String; sSubstring: String; sNewsubstring: string): String;
var
i: integer;
lSub: Longint;
lData: Longint;
begin
  i := 1;
  lSub := Length(sSubstring);
  lData := Length(sData);

repeat
begin
    i := InStr(i, sData, sSubstring);

    If i = 0 Then
    begin
      sNewSubString := sData;
      Exit
    end
    Else
      sData := Copy(sData, 1, i - 1) + sNewsubstring + Copy(sData, i + lSub, lData);
      i := i + lSub;
    End;
 Until i > lData;
  Replace := sData;
end;
function Left(Source: string; Length: integer): string;
begin
	Result := copy(Source,1,Length);
end;
function Right(Source: string; Lengths: integer): string;
begin
Result := copy(source,Length(Source) - Lengths,Lengths);
end;
function Mid(Source: string; Start: integer; Length: integer): string;
begin
	Result := copy(Source,Start,Length);
end;
function InStr(Start: integer; Source: string; SourceToFind: string): integer;
begin
	Result := pos(SourceToFind,copy(Source,Start,Length(Source) - (Start - 1)));
end;
function RightTrim(const s:String):String;
var
  i:integer;
begin
   i:=length(s);
   while (i>0) and (s[i]<=#32) do
      Dec(i);
   result:=Copy(s,1,i);
end;
function LeftTrim(const s:String):String;
var
  i, L:integer;
begin
   L:=length(s);
   i:=1;
   while (i<=L) and (s[i]<=#32) do
      Inc(i);
   result:=Copy(s,i, MaxInt);
end;
end.

Upload
Orijinal Yorumlar (3)
Wayback Machine'den kurtarıldı