Variable is undefined: 'a'

Results 1 to 2 of 2

Thread: Variable is undefined: 'a'

  1. #1
    amos Guest

    Default Variable is undefined: 'a'

    rec this error can someone help? here is script;<BR><BR>&#060;% Option Explicit %&#062;<BR>&#060;!-- #include virtual="common/" --&#062;<BR>&#060;% response.buffer = true%&#062;<BR><BR>&#060;script runat=server language=VBScript&#062;<BR><BR>function formatphone(phone)<BR>a = ""<BR>for x = 1 to len(phone)<BR> t = mid(phone,x,1)<BR> if isnumeric(t) then<BR> a = a & t<BR> end if<BR>next<BR>a = "(" & mid(a,1,3) & ")" & mid(a,4,3) & "-" & mid(a,7,4)<BR><BR>formatphone = a<BR>end function

  2. #2
    12OzCoffeeCup Guest

    Default RE: Variable is undefined: 'a'

    well... you need to define all your variable because you are using Option Explicit.<BR><BR>make sure that anything you&#039re defining (something = "something") is defined by using DIM. Put this at the top of your script:<BR><BR>Dim a, x

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts