PerryRaptor 1 Posted January 30, 2007 I use a single dimension array to capture user input in an edit box, I use StringSplit($ChatBox1, ' ', 1) triggering on a space ' ' to as the delimiter.Sometimes there will not be an element 3, array[3] and I need some way of capturing this error allowing the script to move on.IF array[3] <doesn't exist expression> then array[3] = "parameter is missing...try again"I need help with coding the <doesn't exist expression> Share this post Link to post Share on other sites
BALA 0 Posted January 30, 2007 I use a single dimension array to capture user input in an edit box, I use StringSplit($ChatBox1, ' ', 1) triggering on a space ' ' to as the delimiter. Sometimes there will not be an element 3, array[3] and I need some way of capturing this error allowing the script to move on. IF array[3] <doesn't exist expression> then array[3] = "parameter is missing...try again" I need help with coding the <doesn't exist expression> Perhaps the @error macros may help. You can check to see if an error occurs and have it output what you want. [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Share this post Link to post Share on other sites
PerryRaptor 1 Posted January 30, 2007 project is too big for the @error macro Share this post Link to post Share on other sites
PerryRaptor 1 Posted January 30, 2007 I think I need something along the lines of: If not Ubound($Array) == 4 then $array[3] = "parameter is missing" Share this post Link to post Share on other sites
xcal 3 Posted January 30, 2007 Do $input = InputBox('Test', 'Enter 3 characters') $result = StringSplit(StringStripWS($input, 8), '') If UBound($result) - 1 <> 3 Then MsgBox(0, '', 'Too few or too many characters. Try again.') Until UBound($result) - 1 = 3 MsgBox(0, '', 'success') How To Ask Questions The Smart Way Share this post Link to post Share on other sites
xcal 3 Posted January 30, 2007 welcome How To Ask Questions The Smart Way Share this post Link to post Share on other sites
_Kurt 2 Posted January 30, 2007 Or, say you have several arrays, and for each array you must do something to it, then you would do something like this:For $i = 1 To Ubound($array)-1 ;whatever you want to do to each array ;$array[$i] = each array NextJust thought it would be useful for you to know.Kurt Awaiting Diablo III.. Share this post Link to post Share on other sites