-
ฟังก์ชั่นฟังก์ชั่น: ส่งคืนหนึ่งในค่าที่เลือกตามเงื่อนไขจริงหรือเท็จ
'พารามิเตอร์: blncondition: ตัวแปรเงื่อนไข, varresulttrue: ค่าส่งคืนเมื่อเงื่อนไขเป็นจริง, varresultfalse: ค่าส่งคืนเมื่อเงื่อนไขเป็นเท็จ
functioniif (blncondition, varresulttrue, varresultfalse)
ifcbool (blncondition) จากนั้น
iif = varresulttrue
อื่น
iif = varresultfalse
endif
endfunction
-
ฟังก์ชั่นฟังก์ชั่น: กำหนดว่าองค์ประกอบสตริงอยู่ใน enum ที่กำหนด
'บทความ: Sele: String to Judged, Sarray: ระบุ enum
'ตัวอย่าง: พิจารณาว่าไฟล์ภาพนั้นขึ้นอยู่กับส่วนขยาย: Inarray (StrFileext, "JPG, GIF, BMP, PNG")
FunctionInarray (Sele, Sarray)
dimaarray
Dimi
aarray = split (sarray, ",")
fori = 0toubound (aarray)
iftrim (sele) = trim (aarray (i)) แล้ว
inarray = true
exitfunction
endif
ต่อไป
inarray = false
endfunction
-
ฟังก์ชั่นฟังก์ชั่น: ตรวจสอบว่าสตริงสอดคล้องกับนิพจน์ทั่วไป
'อาร์กิวเมนต์: strstring: string, strpattern: นิพจน์ทั่วไป
functionDoretest (strstring, strpattern)
หรี่แสง
setore = newregexp
Ore.pattern = strpattern
ore.ignorecase = true
doretest = ore.test (strstring)
setore = ไม่มีอะไร
endfunction
-
ฟังก์ชัน 'ฟังก์ชั่น: การสกัดปกติ
'อาร์กิวเมนต์: String: String, Patrn: Expression ปกติ
'return: comma-segment ของอาร์เรย์ผลลัพธ์
FunctionDoreexec (strng, Patrn)
Dimregex, Match, Matches, Retstr 'สร้างตัวแปร
setregex = newregexp 'สร้างนิพจน์ทั่วไป
regex.pattern = โหมด Patrn'set
regex.ignorecase = true 'ถูกตั้งค่าเป็นกรณีที่ไม่รู้สึกตัว
การตั้งค่า regex.global = true 'ใช้ทั่วโลก
setMatches = regex.execute (strng) 'ทำการค้นหา