royd
9 years agoRegular Contributor
Help needed with DDT script, error - "While is not defined"!
Hi every one,
Trying to create new patients from Excel sheet. It is not complaining about .xlsx file (did some research and fixed it, I think). What I am getting now is "While is not defined"! I have no clue why?! Here is my script -
function ddtD(){
try
{
DDT.ExcelDriver("c:\\newPatients.xlsx", "femaileE");
While (!DDT.CurrentDriver.EOF())
{
if (DDT.CurrentDriver.Value("Name") == "Lizzie Hari")
{
New_Patients.createPatients();
}
DDT.CurrentDriver.Next();
}
}
catch(exception)
{
Log.Error(exception.message);
}
DDT.CloseDriver(DDT.CurrentDriver.Name);
}Appreciate any help from the pros.
Dave
Hi,
It is pretty common mistake. While should be while
I hope New_Patients is a Unit name. if not that will also say undefined.
function ddtD(){ try { DDT.ExcelDriver("c:\\newPatients.xlsx", "femaileE"); while (!DDT.CurrentDriver.EOF()) { if (DDT.CurrentDriver.Value("Name") == "Lizzie Hari") { New_Patients.createPatients(); } DDT.CurrentDriver.Next(); } } catch(exception) { Log.Error(exception.message); } DDT.CloseDriver(DDT.CurrentDriver.Name); }