Link to home
Start Free TrialLog in
Avatar of PNKJ
PNKJ

asked on

BC30807: 'Let' and 'Set' assignment statements are no longer supported.

Hi I have ajavascript function in asp site which i am trying to use on asp.net page. Basically on asp page .I have a text box and a drop down list on asp form when a value is selected from dropdown the textbox get filled that value. The following javascript function is being called onchange event of the text box. Suppose user changes the values of the item code a javascript error should pop up.

function GetItemName(myitem)
{
var itemCodeArray = new Array()
var itemNameArray = new Array()
var item_code
var varitem_name = "**ERROR**"
var iii
{
if (myCmdty.length = 0) return true;
}
<%  dim i3 %>
<%  i3 = 0 %>
<%  sql = "select item_code, item_name from items where item_code <> 1 and item_code <> 4 and item_code <> 10order by item_code"  %>
<%  set RecordSet=ODBCConnect.Execute (sql)   %>
<%  ' now grab all the records and put it in an array   %>
<%  do while not RecordSet.eof    %>
<%       response.write "itemCodeArray " & "[" & i3 & "]" & "=" & Recordset.fields(0)& ";" %>
<%       response.write "itemNameArray" & "[" & i3 & "]" & "='" & Recordset.fields(1)& "';" %>
<%       i3 = i3 + 1   %>
<%       RecordSet.movenext    %>
<% loop    %>
for (iii = 0; iii <= 40; iii++)
  {
  if (itemNameArray[iii] == myitem)
      {
      varitem_name = itemNameArray [iii]
      break
      }
  }
{
if (varitem_name == "*ERROR*")
      {
       alert("Bad item code entered.");
       return false;
      }
else
      {
      document.My_form.item_name.value = varitem_name;
      return true;
      }
}
}

When I am trying to use this function in asp.net form i get error message BC30807: 'Let' and 'Set' assignment statements are no longer supported.
 How can I modify this function ?
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi PNKJ,

 <%  set RecordSet=ODBCConnect.Execute (sql)   %>

Should be

 <%  RecordSet=ODBCConnect.Execute (sql)   %>


Tim Cottee
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial