Forum: สอบถามปัญหา Notes ทางด้านพัฒนาโปรแกรม (Note Client) |
Tags1: | Created on Feb 15, 2008, 10:52 AM by 9notes/9Notes|Topic Responses: 5 |
&action=openDocument&documentId=2E82 |
เราสามารถเอา @Function @ValidateInternetAddress มาประยุกต์ใช้ใน LotusScript โดยใช้ Evaluate Function เข้ามาช่วยได้ครับ ตัวอย่างนี้อาจจะไม่ถูกต้องทั้งหมดแต่ก็เอาไปประยุกต์ใช้ได้ครับ
Private Function validateAddress821(address As String) As Integer 'boolean
'validates internet address using RFC821 format
'if valid returns TRUE else sets error code and message and returns FALSE
Dim docTemp As notesDocument
Dim errorMsg As Variant
Set docTemp = getNewDoc()
Let docTemp.address = address
Let errorMsg = Evaluate("@ValidateInternetAddress([Address821]; address)", docTemp)
Delete docTemp
If (errorMsg(0) = "") Then
Let validateAddress821 = True
Else
Call Me.setError(MailSender_ERR_ADD, errorMsg(0))
Let validateAddress821 = False
End If
End Function
:yellow_cool.gif:
[quote]แสดงว่ามันไม่มีคำสั่งประมาณแบบ Regular Expression เอาไว้เช็คความถูกต้องของเมล์
ใช่ไหมครับ[/quote] |
|