Solved

Type Mismatch while using Split on an array...???

Posted on 2006-11-13
2
396 Views
Last Modified: 2012-06-27
I've got some values stored in an array like so:

CustomInformation = 555-555-5555 | FedEx Ground | de | 123

I'm trying to get each piece into its own variable so I used Split:

Split(CustomInformation = 555-555-5555 | FedEx Ground | de | 123,"|")

Then, if I go ahead and print these values to the screen it works fine:

Response.Write(CustomInformationSplit(0) & "<br>" & CustomInformationSplit(1) & "<br>" & CustomInformationSplit(2) & "<br>" & CustomInformationSplit(3))

However, when I try and simply populate a new variable with the value of the first array value, the phone number, I'm getting a type mismatch error.

billingPhoneNumber = CustomInformation(0)

returns

Microsoft VBScript runtime  error '800a000d'
Type mismatch: 'CustomInformation'

I'm guessing it must be something to do with the -'s?  Is it trying to subtract 555 from 555 from 555?  How do I make this work?  Any information would be greatly appreciated.  thanks!
0
Comment
Question by:Andrew Angell
2 Comments
 
LVL 18

Accepted Solution

by:
Morcalavin earned 250 total points
ID: 17932273
I thought your array  name was CustomInformationSplit, but here you have:
billingPhoneNumber = CustomInformation(0)

Should be:
billingPhoneNumber = CustomInformationSplit(0)

Split should be
CustomInformationSplit = Split(YourData, "|")
0
 
LVL 11

Author Comment

by:Andrew Angell
ID: 17932632
Well write moron on my forehead.  You got it!  thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now