Jump to content

StringRegExpReplace and extended


Uten
 Share

Recommended Posts

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)
EndFunc

EDIT: 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 by Uten
Link to comment
Share on other sites

*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..:)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...