Micro Focus QTP (UFT) Forums
If/then Statement issues - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Regular Expressions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Regular-Expressions)
+--- Thread: If/then Statement issues (/Thread-If-then-Statement-issues)



If/then Statement issues - Carver2469 - 06-30-2015

I have this If statement multiple times for different WorkCenters but this one with the letter in it is giving me errors...(the L at the end of 45205L in the first line is the issue)

Code:
If DataTable.Value("WC","ApexProcessMOs")=45205L Then
    EWC="45205L-FABRIC LAM & ASSM LAUNCH (45205L)"
End If

It's giving me an EXPECTED 'THEN' error along with an "EXPECTED END OF STATEMENT" error


RE: If/then Statement issues - supputuri - 06-30-2015

Try this.
Code:
If DataTable.Value("WC","ApexProcessMOs")="45205L" Then



RE: If/then Statement issues - vinod123 - 11-03-2015

try the below syntax


Code:
If (DataTable.Value("WC","ApexProcessMOs") = "45205L") Then
   EWC="45205L-FABRIC LAM & ASSM LAUNCH (45205L)"
End If