Solved

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

Posted on 2006-11-13
2
399 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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