Cap0 Posted May 3, 2007 Posted May 3, 2007 here's my code: $f = "why hello" $a = stringreplace($f," ","") Dim $arr[stringlen($a) / 2 - 1] for $i = 0 to stringlen($a) / 2 - 1 $arr[$i] = "hey" Next Msgbox(0,'',$arr[2]) i get error: array variable has incorrect number of subcripts or dimension range has exceeded; something along those lines.
Shevilie Posted May 3, 2007 Posted May 3, 2007 To simplify i used a constant Dim $arr[2] for $i = 0 to 2 $arr[$i] = "hey" NextoÝ÷ Ù8b³¥¥ê¹Çê뢷nzÚ4ߦ«®+6n(ºØ§Ê«)ʯ+hz{^¯}5Ù8b²+-éè®f¥Á¬¢f¤y©h¢è¬!¢W®¶²jëh×6Dim $arr[2] for $i = 0 to (UBound($arr] - 1) $arr[$i] = "hey" Next Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
Uten Posted May 3, 2007 Posted May 3, 2007 Use Dim $arr[Round(stringlen($a) / 2 - 1, 0)] when you dimension the array don't think 3/2=1.5 will go down well.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Cap0 Posted May 3, 2007 Author Posted May 3, 2007 Hi, Thanks for the replies! works good, thanks again.
Shevilie Posted May 3, 2007 Posted May 3, 2007 Use Dim $arr[Round(stringlen($a) / 2 - 1, 0)] when you dimension the array don't think 3/2=1.5 will go down well..Uuuh didn't see that.. good catch Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now