Jump to content

Recommended Posts

Posted

Developed on AutoIt v3.1.1.110 (beta)

Keypoints: @ScriptFullPath, @ScriptLineNumber, FileReadLine(), StringRegExp()

assert.au3 in the include directory

#include-once

func assert($b, $i = @ScriptLineNumber)

if $b then return

local $p

$p = @ScriptFullPath

$b = StringRegExp(FileReadLine($p, $i), "assert[ \t]*\([ \t]*(.+)\)", 1)

ConsoleWrite("assert failure:(" & $b[0] & ")," & $p & ",line " & $i & @CRLF)

ConsoleWrite("@error:" & @error & ", @extended:" & @extended & @CRLF)

exit

endfunc

example)

#include <assert.au3>

$h = DllOpen("kernel32x.dll") ; intentionally mistyped!

assert($h <> -1)

DllCall($h, "ptr", "GetModuleHandle", "ptr", 0)

DllClose($h)

assert.zip

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
  • Recently Browsing   0 members

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