Micro Focus QTP (UFT) Forums

Full Version: If/then Statement issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Try this.
Code:
If DataTable.Value("WC","ApexProcessMOs")="45205L" Then
try the below syntax


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