• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

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
0
jonnygrant
Asked:
jonnygrant
  • 2
1 Solution
 
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now