Maximus1 Posted July 13, 2010 Share Posted July 13, 2010 (edited) hi there, the folowing line brings an error when $source has no data matching $Stringleft2 and/or $Stringright2 $string2=_StringBetween($source,$Stringleft2,$Stringright2) how do i use the error to go to the following code, which is at the end of my script? $a=$a+1 If $a = 999999 Then MsgBox(0,"Ende","ende") ExitLoop EndIf WEnd thanks for your help Edited July 13, 2010 by Maximus1 Link to comment Share on other sites More sharing options...
JohnOne Posted July 13, 2010 Share Posted July 13, 2010 (edited) You will need to create a function to call when you recieve your error code $string2=_StringBetween($source,$Stringleft2,$Stringright2) If @error Then _mycode() EndIf Func _mycode() ;handle error EndFunc Edited July 13, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maximus1 Posted July 13, 2010 Author Share Posted July 13, 2010 ok but how do i jump back to my while loop after that? $string2=_StringBetween($source,$Stringleft2,$Stringright2) If @error Then _mycode() EndIf Func _mycode() $a=$a+1 If $a = 999999 Then MsgBox(0,"Ende","ende") ExitLoop EndIf "jump to the beginning of the while loop" <------------how? EndFunc Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 13, 2010 Share Posted July 13, 2010 We can't help you with that as there is no while-loop in the example you posted. We are not mind-readers. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
JohnOne Posted July 13, 2010 Share Posted July 13, 2010 Once your function is complete, your script execution will return to wherever it was called from. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Maximus1 Posted July 13, 2010 Author Share Posted July 13, 2010 (edited) We can't help you with that as there is no while-loop in the example you posted. We are not mind-readers. no you are not mind-readers, but you are skilled. when you think about the given information you will see that there is something - that counts from 1 to 999999 - that writes an reads arrays where can you write and read arrays up to 999999 times? in a loop? and sometimes the needed data are not available. if you don`t want to help me, read this topic but do not use your keyboard. lame sentences about mind-readers are not so cool as you think. ----------------- i helped myself HotKeySet("{PGUP}","start") . . Send("{PGUP}") Func start() . . . . EndFunc . . . Func _mycode() DirRemove($dir& $string[0]) $a=$a+1 Tooltip("" & $a,461, 1028) If $a = 999999 Then MsgBox(0,"Ende","ende") Exit() EndIf Send("{PGUP}") EndFunc Edited July 13, 2010 by Maximus1 Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted July 13, 2010 Share Posted July 13, 2010 @Maximus1 Oh my god. Are you really that stupid or are you just pretending? Our skills is irrelevant, since you gave us NOTHING to work on. What you asked may as well be, "what is x + y". You didn't tell us what x is. You didn't tell us what y is. If you give us NO DETAILS about the problem then NOBODY can help you. And seriously, that code you posted now doesn't make any bloody sense at all. The loop is still missing. _mycode() is never called. And why the hell are you using Send() on a key that's HotKey'ed? That is without doubt one of the worst scripts EVER created, and by making it IMPOSSIBLE for us to help you it will stay that way. Now the next time you create a thread, you MUST post a reproducer. It must be short and runnable/working. Without it we can't help you, because as I said earlier, WE ARE NOT MIND-READERS. Unless we know EXACTLY what the problem/question is about we CAN'T help you. You will also notice that the solution for the problem can often be found while writing the reproducer. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
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