Uten Posted February 4, 2008 Share Posted February 4, 2008 (edited) I would expect @extended to be something else than 0 in the StringRegExpReplace helpfile sample (autoit-v3.2.11.0).Maybe a minor bug that has sneaked in a again as it seems to have been addressed before?Before I report this as a bug could someone verify that I have understood the docs right. Or, horror, if I have goofed in my code.testStringRegExpReplace() Func assert($test, $msg="", $line=@ScriptLineNumber, $error= @error, $extended=@extended) If Not $test Then ConsoleWrite("(" & $line & ") := (" & $error & ")(" & $extended & ")FAILED::$msg:=" & $msg & @crlf) EndFunc func testStringRegExpReplace() Local $data = StringRegExpReplace("Where have all the flowers gone, long time passing?", "[aeiou]", "@") Local $error = @error Local $extended = @extended assert( "Wh@r@ h@v@ @ll th@ fl@w@rs g@n@, l@ng t@m@ p@ss@ng?" = $data, $data) assert(15 = $extended, "@extended:=" & $extended) assert(0 = $error, "@error:=" & $error) EndFuncEDIT: AS it turns out I had placed an assert call before I saved @extended Corrected the provided code. And modified assert to the proper version and not the lazy one. Thanks to w@eaponx and @Siao for pointing out the obvious. Edited February 4, 2008 by Uten 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 Link to comment Share on other sites More sharing options...
weaponx Posted February 4, 2008 Share Posted February 4, 2008 Well you are calling a function which contains ConsoleWrite() after your StringRegExpReplace so @Extended should be overwritten at that point. Link to comment Share on other sites More sharing options...
Siao Posted February 4, 2008 Share Posted February 4, 2008 At the start of ANY function (internal or user defined) error flags are reset to 0. "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Uten Posted February 4, 2008 Author Share Posted February 4, 2008 *Grumble*, *grumble*. The weakest link is always behind the keyboard Knew it was a reason I usually used to pass on @extended and @error to the assert function. Thanks both of you.. 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 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