Arsip: Gmana Memanggil Function ini ??

 
user image
more 14 years ago

daryl_sukma_gumilar

Assalamualaikum ... Master2 Delphi ... Saya Delphier Beginner .. Mau tanya .. saya dapet function menarik dari http://delphi.about.com/cs/adptips2003/a/bltip0203_3.htm Seperti ini Functionya uses SysUtils; function IsLike(AString, Pattern: string): boolean; var j, n, n1, n2: integer ; p1, p2: pchar ; label match, nomatch; begin AString := UpperCase(AString) ; Pattern := UpperCase(Pattern) ; n1 := Length(AString) ; n2 := Length(Pattern) ; if n1 < n2 then n := n1 else n := n2; p1 := pchar(AString) ; p2 := pchar(Pattern) ; for j := 1 to n do begin if p2^ = '' then goto match; if (p2^ <> '?') and ( p2^ <> p1^ ) then goto nomatch; inc(p1) ; inc(p2) ; end; if n1 > n2 then begin nomatch: Result := False; exit; end else if n1 < n2 then begin for j := n1 + 1 to n2 do begin if not ( p2^ in [' ','?'] ) then goto nomatch ; inc(p2) ; end; end; match: Result := True end; Kalau saya ingin Mencari ketidakmiripan Terkecil = match Kemudian Memanggil function tersebut dengan sebuah button gmana ya ?? Terimakasii ;-)
user image
more 14 years ago

n3o_cybertech

Sometimes we need to know if a string matches a pattern, which is a string with wildcards ( for example ? and ) . ~~~~~~~~~~~~~~~~~~~~~~~~~

{
Usage:
if IsLike('About Delphi', 'Abo?? Delp ') then
   ShowMessage('A match!') ;
}
[ditemukan di web itu juga, dicoba dulu]
user image
more 14 years ago

daryl_sukma_gumilar

@ master n3o : Thx Bgt .. Saya coba carii dulu ;-)
user image
more 14 years ago

daryl_sukma_gumilar

@ Master n3o : maav Master yang saya tanyakan bagaimana memanggil function tsb dengan Sebuah Procedure ...
user image
more 14 years ago

herux

Maksudmu callback ?
user image
more 14 years ago

daryl_sukma_gumilar

@ Master Herux : Iyaa Master ...
more ...
  • Pages:
  • 1
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com