Arsip: Gmana Memanggil Function ini ??
more 15 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 ;-)
more 15 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]
more 15 years ago
daryl_sukma_gumilar
@ Master n3o : maav Master yang saya tanyakan bagaimana memanggil function tsb dengan Sebuah Procedure ...
more ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward
🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 5 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 5 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 13 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 13 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 13 years ago
Random Topic
- Cara mengatasi error "INVALID FLOATING POINT OPERATION&
by reza_elka in Tip n Trik Pemrograman more 14 years ago - [ask]Merubah font secara menyeluruh dalam aplikasi
by dr4cul453xy in Network, Files, I/O & System more 19 years ago - nempelin TImage ke komponen spreadsheet devexpress
by brainwashed in Tip n Trik Pemrograman more 18 years ago - Tanya ebook tentan Indy
by purnomo2007 in Multimedia & Graphic Enhancement more 14 years ago - tanya component ..?
by nurez in Tip n Trik Pemrograman more 19 years ago - cara non aktif login
by trimbil in Tip n Trik Pemrograman more 17 years ago - Problem load transparansi image PNG
by ivan in Hal umum tentang Pascal Indonesia more 19 years ago - Borland Delphi 7 in Windows Vista
by BorlandMania in Hal umum tentang Pascal Indonesia more 17 years ago - Maintenanced Reporting ::
by Tbawor in Moderator Only more 17 years ago - dbGridku berkedip kayak lampu DISKO asikk eh salah Tolonggg!
by joudie in Hal umum tentang Pascal Indonesia more 16 years ago
