Subscript out of range: '[number: 1]'
I keep getting this error:
Code:
Microsoft VBScript runtime (0x800A0009)
Subscript out of range: '[number: 1]'
/info.asp, line 79
With this line of code:
Code:
IF (lCase(cStr(fileextension(1))) <> "jpg") AND (lCase(cStr(fileextension(1))) <> "jpeg") AND (lCase(cStr(fileextension(1))) <> "gif") THEN
Can someone please explain why? Thanks!
Re: Subscript out of range: '[number: 1]'
That error is one of the ones covered in the article What does this error mean, and how do I fix it? from our Classic VB FAQs (in the FAQ forum)
In this particular case, it seems that fileextension hasn't got an element 1, but without seeing more code we cannot tell why that might be
Re: Subscript out of range: '[number: 1]'
The code wasn't checking the field for being blank so I just added an IF statement. That worked. Thanks for the references and explanation!