ฟังก์ชั่นส่วนหัว rightstr (const atext: string; const acount: integer): string;
ฟังก์ชั่นส่งคืนอักขระ acount ทางด้านขวาของสตริง atext
คำอธิบาย Rightstr ('123456', 3) = '456'
อ้างถึง function system.copy
ตัวอย่าง edit3.Text: = rightStr (edit1.text, spinedit1.value);
ฟังก์ชั่นส่วนหัว MIDST
ฟังก์ชั่นส่งคืนอักขระ atext acount สตริงเริ่มต้นจาก Astart
หมายถึงสำเนา
อ้างถึง function system.copy
ตัวอย่าง edit3.Text: = midstr (edit1.text, spinedit1.value, spinedit2.value);
ฟังก์ชั่นส่วนหัว SearchBuf (buf: pchar; buflen: จำนวนเต็ม; selstart, sellength: integer; searchString: สตริง; ตัวเลือก: tStringSearchOptions = [sodown]): pchar; $ [strutils.pas
ฟังก์ชั่นส่งคืนตำแหน่งตัวชี้ค้นหาครั้งแรก
อธิบายฟังก์ชั่นนี้มักจะใช้ในการค้นหาสตริงในข้อความ
อ้างอิง <Null>
ตัวอย่าง
/////////// เริ่ม SearchBuf
ฟังก์ชั่น searchedit (editControl: tcustomedit; const searchstring: สตริง;
SearchOptions: TStringSearchOptions;
วาจา
บัฟเฟอร์, P: pchar;
ขนาด: Word;
เริ่ม
ผลลัพธ์: = เท็จ;
ถ้า (ความยาว (searchString) = 0) จากนั้นออก;
ขนาด: = editControl.getTextlen;
ถ้า (ขนาด = 0) ออกจาก;
บัฟเฟอร์: = stralloc (ขนาด + 1);
พยายาม
editControl.getTextBuf (บัฟเฟอร์, ขนาด + 1);
P: = SearchBuf (บัฟเฟอร์, ขนาด, editControl.SelStart, editControl.sellength,
SearchString, SearchOptions);
ถ้า p <> ไม่มีเริ่มต้น
editControl.SelStart: = p - บัฟเฟอร์;
editControl.Sellength: = ความยาว (SearchString);
ผลลัพธ์: = จริง;
จบ;
ในที่สุด
strdispose (บัฟเฟอร์);
จบ;
จบ;
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
SearchOptions: TStringSearchOptions;
เริ่ม
searchoptions: = [];
ถ้าช่องทำเครื่องหมายที่ตรวจสอบแล้ว
รวม (searchoptions, sodown);
หากช่องทำเครื่องหมาย
รวม (searchoptions, somatchcase);
ถ้าช่องทำเครื่องหมายที่ตรวจสอบแล้ว
รวม (searchoptions, sowhoLeword);
Searchedit (memo1, edit1.text, searchoptions);
memo1.setFocus;
จบ;
/////////// สิ้นสุดการค้นหา
ฟังก์ชั่นส่วนหัว soundex (const atext: string; alength: tsoundexlength = 4): สตริง;
ฟังก์ชั่นส่งคืนสตริงการตรวจจับ
คำอธิบาย: ตามวิธีการตรวจจับ (Soundex) คุณสามารถค้นหาสตริงที่ตัดกันได้
อ้างอิง <Null>
ตัวอย่าง edit2.text: = soundex (edit1.text, spinedit1.value);
ฟังก์ชั่นส่วนหัว soundexint (const atext: string; alength: tsoundexintlength = 4): จำนวนเต็ม;
ฟังก์ชั่นส่งคืนจำนวนเต็มตรวจจับ
หมายความว่ายิ่งค่าของความยาวมากเท่าไหร่ความแม่นยำในการถอดรหัสก็จะยิ่งสูงขึ้น
อ้างอิง <Null>
ตัวอย่าง spinedit2.value: = soundexint (edit1.text, spinedit1.value);
ฟังก์ชั่นส่วนหัว decodesoundexint (Avalue: Integer): String;
ฟังก์ชั่นส่งคืนการถอดรหัสของจำนวนเต็มโพรบ
คำอธิบาย DecodesoundExint (SoundExint ('Hello')) เทียบเท่ากับ SoundEx ('Hello')
อ้างอิง <Null>
ตัวอย่าง edit2.text: = decodesoundexint (spinedit2.value);
ฟังก์ชั่นแรก SoundExword (const atext: string): word;
ฟังก์ชั่นส่งคืนค่าข้อความตรวจจับ
บ่งชี้ว่าไม่มีความยาวพารามิเตอร์ที่ได้รับการแก้ไขถึง 4
อ้างอิง <Null>
ตัวอย่าง spinedit2.value: = soundexword (edit1.text);
ฟังก์ชั่นแรก decodesoundexword (Avalue: Word): String;
ฟังก์ชั่นส่งคืนการถอดรหัสของค่าข้อความตรวจจับ
คำอธิบาย decodesoundexword (soundexword ('hello')) เทียบเท่ากับ soundex ('hello')
อ้างอิง <Null>
ตัวอย่าง edit2.text: = decodesoundexword (spinedit2.value);
ฟังก์ชั่นส่วนหัว soundexsimilar (const atext, aother: string; alength: tsoundexlength = 4): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าจะเป็นสตริงโพรบของสองสายเท่ากัน
คำอธิบายผลลัพธ์: = soundex (atext, alength) = soundex (aother, alength)
อ้างอิง <Null>
ตัวอย่าง checkbox1.Checked: = soundexsimilar (edit1.text, edit2.text, spinedit1.value);
ฟังก์ชั่นส่วนหัว SoundExCompare (const atext, aother: string; alength: tsoundexlength = 4): จำนวนเต็ม;
ฟังก์ชั่นส่งคืนผลลัพธ์ของการเปรียบเทียบสองสตริงเพื่อตรวจจับสตริง
คำอธิบายผลลัพธ์: = ansicomparest
ฟังก์ชั่นอ้างอิง sysutils.ansicomparest
ตัวอย่าง spinedit2.value: = SoundExCompare (edit1.text, edit2.text, spinedit1.value);
ฟังก์ชั่นแรก SoundExproc (const atext, aother: string): บูลีน;
ฟังก์ชั่นเรียกใช้ soundexsimilar เพื่อส่งคืนสตริงโพรบของสองสตริง
คำอธิบายของค่าเริ่มต้นของตัวแปรระบบ ansiresemblesproc
ฟังก์ชั่นอ้างอิง strutils.ansiresemblestext
ตัวอย่าง [var ansiresemblesproc: tcomparetextproc = soundexproc;]