[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Type mismatch for array variable in vbs when using split to define it

Posted on 2007-03-29
5
Medium Priority
?
824 Views
Last Modified: 2012-05-05
I keep getting a type mismatch error with this script for the array variable (websitearray) I'm trying to create from splitting the long text string:

OPTION EXPLICIT
dim websites
dim websitearray
Dim i
Dim domain

websites = "adamphotogallery.com addisongeary.com ambermckenzie.com amyherr.com amysphotographix.com annelizabethschlegel.com apiphotography.com arondaphotography.com ashoksinha.com avianstock.com bernicesnyder.com bigblackbag.com bigblackbag.net bigskylivingstonweddings.com bonvivantcinema.com breshearsphoto.com carolbethicard.com carolyncarr.com chrishiers.com colortecllc.com danbenner.com dancrawford.com dandelouise.com danielmartinezphoto.com daunesheriartstudio.com deanimages.com dennis-sagwitz.com dewdropphotography.com dickmanportfolio.com dillingerkovach.com dm7studios.com dmooreartist.com doughopfer.com drewcallaghanphotography.com eajphoto.com ellenrosenthal.com encamera.com figmentsphotography.com figmentsphotography.com.au fireflyfoto.net fleischmanphoto.com foxreps.com freedomphotos.net fusionphotography.biz gabrielvaningen.com griffithphotography.com growth2.net hollyhodson.com inspiredfirstbrand.com ion-photography.com jadepegler.net jamesejohnson.com janetbartlettgoodman.com janetlynnphotography.com jeffseltzerphotography.com jenmayphotography.com johnjonasweb.com jonathanbroadbent.com julianhaber.com katarinablazevic.com katemccoy.net kaythorogoodphotography.com kemperimagery.com kenkwok.com kgfineart.com kortduce.com lasalaphotos.com laurajohansen.com liakassart.com lostcoaststudio.com louisanastas.com lyndontravers.com marcialeeder.com marginadennis.com markandreani-fashion-photography.com markandreani.com marksandersonphoto.net martyjonas.com mcdonald-media.com mdmphotostudio.com midjo-pasto-gallery.com mikebullimages.com misha-mccrary.com mwestermeier.com nathansmithphoto.com nbimages.net nicolebrunsonphotography.com nitawinterandrobbadgerphotography.com oshun-jewelry.com pamlottphotoillustration.com patricklinehan.com photographertoronto.ca photosbywally.com pixlitter.com polecatmedia.com powerlunchproduction.com prismaproductions.com raeoflightphotography.com rboephoto.com robinsoneditions.com robkarosis.com robpena.com ronaldserfassartist.com rose-photography.com rossstockwellphotography.com rpughphoto.com samanthabender.com samdamico.com sealpointdesigns.com shellycastellano.com shrimptoncouture.com shrimptoncouture2.com simonrickerty.com simonryder.co.uk sl4design.com sofiaharrison.com spotstok.org steffanhacker.com stellarfilms.net stevenstills.com steveryanart.com stevetruongphotography.com tamarakay.com theartofthecurve.com thedalyblog.com thereseflanagan.com thestudioofphotography.com thomasbollinger.com thomaskosaphotography.com tpquigley.com tsirrell.com upstairsartspace.org venividiphoto.com wooddellstudio.com worksonpaper.biz yellowstonephotos.net yes.on.ca yourdreamimages.com"


websitearray = split(websites," ")

For i = 0 to ubound(websitearrray)
changethedns(websitearray(i))
Next

SUB changethedns ( domain )
WScript.Echo domain
END SUB

I have tried declaring like so:
dim websitearray()

but this fails as well.

Can you tell me why?
0
Comment
Question by:juliandormon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 2000 total points
ID: 18817060
Hi Julian,

The split works well by itself, it could be because there is an extra 'r' in 'websitearray' in the line:
For i = 0 to ubound(websitearrray)

Changing that gets your above code to work fine. I'm not sure if it was a typo while posting, if so then I'm guessing your actual changethedns sub could be different than just a wscript.echo

Matt
0
 

Author Comment

by:juliandormon
ID: 18817122
Doh! damn typos. Thanks a lot
0
 
LVL 35

Expert Comment

by:mvidas
ID: 18817133
I do it all the time :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

649 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