 |
|
เงื่อนไข ถ้าเจอค่าว่าง(เช่น ""," ", " ") ในตัวแปรเขียนยังไงเหลอครับ |
|
 |
|
|
 |
 |
|
ผมเขียนเป็น Function ให้ครับ
Code (ASP)
Function IsEmptyVar(ByVal strCheck)
IsEmpty = ("" = RTrim(strCheck)) Or (IsEmpty(strCheck)) Or (IsNull(strCheck))
End Function
IF IsEmptyVar(var) Then
Response.write "empty"
End IF
|
 |
 |
 |
 |
Date :
2012-11-12 09:44:29 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับพี่วิน
Code (ASP)
If Instr(emp," ") Or Instr(emp," ") Or Instr(emp," ") Then
emp=replace(emp," "," ") 'replace " " ด้วย " "
emp=replace(emp," "," ") 'replace " " ด้วย " "
emp_sp=Split(emp," ")
emp0=emp_sp(0)
emp1=emp_sp(1)
'Response.write emp0&"<br>"&emp1
Else
emp0="-"
emp1="-"
'Response.write emp0&"<br>"&emp1
End if
|
 |
 |
 |
 |
Date :
2012-11-12 10:37:13 |
By :
imperator |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|