CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft VBScript runtime error '800a01f5' Illegal assignment

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    134
  • Date Created
    Wednesday, May 11, 2011
  • This Article Has been Viewed
    4657 times
  • Short Desc
    If you have a function and a variable with the same name, you will get the 800a01f5 Illegal assignment error. Make sure that all names, functions and variables are different.
  • Details
    If you are using a FUNCTION within your script, and you try to use the FUNCTION's name as a Variable for something else, you will get the following error.

     
    Microsoft VBScript runtime error '800a01f5'
    Illegal assignment: 'getRating'
    /update.asp, line 3

  • Recreate Issue
    To recreate the issue.

    <%
    Function getRating()
    end Function

    getRating = request("rating")
    %>


    As you can see in the above example, we have our FUNCTION getRating()
    And then we creating the Variable of getRating, and this clashes, as it is the same name.
  • Resolve Issue
    To resolve this issue.

    <%
    Function getRating()
    end Function

    getRated = request("rating")
    %>


    In the above example, we changed our Variable name to getRated.
    This will allow our code to function properly and without issue.