Results 1 to 2 of 2

Thread: asp

  1. #1
    resolve Guest

    Default asp

    Hi,<BR>i am using the function Mid in server side script<BR>But i get an error saying "invalid procedure call"<BR>The method works fine with constants..<BR>but does not work if variables are passed to the function.<BR>I have said :<BR>Mid(str,strstart,strend)<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: asp

    First of all, the third parameter is a LENGTH OF SUBSTRING, not an ending position within the original string. Therefore, to extract the 3rd through 6th characters of this string:<BR><BR> &#039ABCDEFG&#039<BR><BR>you would use:<BR><BR> strNew = mid(strOrig, 3, 4)<BR><BR>instead of<BR><BR> strnew = mid(strOrig, 3, 6)<BR><BR>If you used the second form (which is what you indicated you did), then you would exceed the length of the original string and generate an error.<BR><BR>Second, be sure that the string from which you are trying to extract a substring is a valid string (not an array or a number, etc.) and that it has enough characters to fulfill your request.

Posting Permissions

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