VBSCRIPT - ARRAYS

I'm currently developing a web page counter that will store all the counts of the page and the title of the web page in one file..

Having a problem with using the SPLIT COMMAND

Getting a type mismatch error

Code here:

Dim ArrTemp(3)
ArrTemp = Split CounterFile.ReadLine, " ")
            
ArrTemp(0)=Page
ArrTemp(1)=[PageNr]
ArrTemp(2)=[PageCount]

'PageNr and PageCount are extracted
intPageNr = ArrTemp(1)
intPageCount = ArrTemp(2)

anybody any clues or examples on developing a web page counter
jonnygrantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jaywalkCommented:
Could be wrong, but you seem to be missing a bracket.

ArrTemp = Split CounterFile.ReadLine, " ")

might be:
ArrTemp = Split(CounterFile.ReadLine, " ")

Don't suppose it's that simple, is it?

Jaywalk/
0
hesCommented:
Try this
Dim ArrTemp
ArrTemp = Split(CounterFile.Readline," " ,-1)
0
anthonycCommented:
Split expects a dynamic array.  It can not be made the way you are doing it:

dim x(3) 'no good

dim x() 'good
redim x(0 to 3)

Anthony
0
anthonycCommented:
my comment was meant to be an answer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.