Hey guys!
While executing this command:
$b_html = _IEBodyReadHTML ($oIE)
$b_b = _StringBetween ($b_html, "document.snd.t"&$b_unit&".value=", ";")
$t_built = $t_built + $b_b[0]
I get this error:
dra2.au3 (138) : ==> Subscript used with non-Array variable.:
$t_built = $t_built + $b_b[0]
$t_built = $t_built + $b_b^ ERROR
I know "why" this is happening - This is reading from a website and inserting this info into another function. But $b_b is only a valid array when the _StringBetween is functional. So if the website takes to long to load, or it loads wrong, my program crashes. Is there any possible way to make it.. Not crash when this fails?
Thanks,
Olsson
I won't contribute with any code, but I'll tell you what:
I think AutoIt is what you're looking for and that you need to read up on several commands regarding this, how about starting with an easier project? Also, you don't need to set up rules regarding this specific thread, just makes you look like a fool. How about your appreciate the help you get from people?
Func func1()
MsgBox("", "Function1!", "This is function 1", 0)
EndFunc
Func func2()
MsgBox("", "Function1!", "This is function 2", 0)
EndFunc
Func func3()
MsgBox("", "Function1!", "This is function 3", 0)
EndFunc
$i = 1
While $i = 1
$rMessage = Random (1, 3, 1)
MsgBox ("", "Random", $rMessage, 0)
If $rMessage = 1 Then func1()
If $rMessage = 2 Then func2()
If $rMessage = 3 Then func3()
$i = $i + 1
WEnd
I wrote this, works.
$var = PixelGetColor(668, 448)
$col = Hex($var, 6)
MsgBox (1, "", $col, 0)
If $col = 0x33131 Then msgbox(1,"Working?","Nope is not working")
I think this is what you're looking for?