Re: ASP Mid Function Error
well i did some browsing and stuff but i could only find the Mid command ina response.write, not that that should really make a difference but i can't find any work where it is being used outside it.
i asked around a bit also, they all didn't know bout it either, so maybe you have to find a different way to make it do what you are doing.
Re: ASP Mid Function Error
Yeah, I know Dorbian...it does not make sense at ALL. I have used the Mid function in different places. I was wondering if maybe I am somehow embedding the function itself into my ASP page incorrectly...but I can't figure it out.
Re: ASP Mid Function Error
well i found something on Mid and as it seems, you are using it wrong :S i have the link to the page, i hope it will be usefull to you.
http://www.w3schools.com/vbscript/func_mid.asp
Re: ASP Mid Function Error
From a VB point of view your usage of Mid is ok, but the loop it is contained in isn't.
The error you are getting occurs with Mid if the first numeric parameter is 0 or less, and you loop does not enforce a minimum value.
I would recommend either this:
VB Code:
i = Len(strFullPath)
Do Until Left(str, 1) = "\" Or Left(str, 1) = ":" Or i <= 1
str = Mid(strFullPath, i - 1)
i = i - 1
Loop
or this:
VB Code:
For i = Len(strFullPath) To 2 Step -1
If Left(str, 1) = "\" Or Left(str, 1) = ":" Then Exit For
str = Mid(strFullPath, i - 1)
Next i
Re: ASP Mid Function Error
Excellent Si. Thanks to both of you. It's great to find a forum I can go to and get answers when I have problems. You may see me here a bit more.
Thanks again for your help.
Knee Deep