Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Else If problem

Status
Not open for further replies.

Nozy

Technical User
Jun 13, 2001
49
GB
Greetings

Tying to use the IF ELSE statment where am I going wrong.

<PACKAGE>
<JOB ID=TestCase>
<SCRIPT LANGUAGE="JScript" SRC="..\..\Envox.js" />
<SCRIPT LANGUAGE="JScript">

var vTestName=WScript.ScriptName;

ECP.Variable["CustomerXMLString"]="";
ECP.Variable["ServiceType"]="GAS";
ECP.Variable["CurrentProcess"]="";
ECP.Variable["ICECustomerId"]="";

</SCRIPT>
<SCRIPT LANGUAGE="JScript" SRC="..\..\Customer Get Details.js" />
<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Main Menu.js" />
<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Meter Reading.js" />

if (ServiceType=GAS)
}
<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Gas Meter Reading.js" />
}
else
{
<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Electricity Meter Reading.js" />
}

<SCRIPT LANGUAGE="JScript" SRC="..\..\Get Service By Type.js" />
<SCRIPT LANGUAGE="JScript" SRC="..\..\Envox Results.js" />
</JOB>
</PACKAGE>

Cheers
Nozy
 
Try:

Code:
if (ServiceType=GAS)
}
[b]document.write('<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Gas Meter Reading.js" />');[/b]
}
else
{
[b]document.write('<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Electricity Meter Reading.js" />');[/b]
}

'hope that helps!

--Dave
 
The opening bracket after your if clause is backward?
It should be:

Code:
if (ServiceType=GAS)
[b]{[/b]
<SCRIPT LANGUAGE="JScript" SRC="..\..\Can Do Gas Meter Reading.js" />
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top