Opt("GUIOnEventMode", 1) Opt("GUIEventOptions", 1) Opt("MustDeclareVars", 1) #include-once #include #include #include #include #include #include #include ;~ https://github.com/ez2sugul/stopwatch_client/blob/master/JSMN.au3 Global Const $SD = "Scripting.Dictionary" Global Const $ROOT = Round(Sqrt(2) / 2, 3) Global $hImage3 Global $hBmpCtxt3 Global $iXX, $iYY, $ii, $jj Global $iWW, $iEE, $iNN, $iSS, $iNW, $iNE, $iSW, $iSE Global $iEval Global $oWall = ObjCreate($SD) Global $oActor = ObjCreate($SD) Global $oWall = ObjCreate($SD) Global $oImage = ObjCreate($SD) Global $oTiles = ObjCreate($SD) Global $oLayers = ObjCreate($SD) Global $oGrid = ObjCreate($SD) Global $hUser32 = DllOpen("User32.dll") Global $aPress[6] = [False, False, False, False, False, False] Global $aKeys[6] = [11, 20, 25, 26, 27, 28] Global $aGrid[1][1] Global $aGui[9] Global $iDir Global $iWalk Global $JSON Global $img Global $iMov Global $hGDI = True Global $GRID_GUI_HANDLE, $GRID_GUI_TITLE Global $GRID_W, $GRID_WZ, $GRID_H, $GRID_HZ Global $GRID_LIMIT_TOP, $GRID_LIMIT_RIG, $GRID_LIMIT_BOT, $GRID_LIMIT_LEF Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Global $hGraphic, $hPen, $hBitmap, $hBackbuffer Global $hBrush Global $hMatrix Global $TILE = 0 OnAutoItExitRegister("__Grid_OnExit") Func Grid_Create($sTitle = "", $map = "", $iZoom = 1, $iTime = 20) $GRID_GUI_TITLE = $sTitle $JSON = Grid_LoadFile($map) Global Const $GRID_ZOOM = (Number($iZoom) < 0) ? 1 : Number($iZoom) $iTime = (Number($iTime) < 10) ? 10 : Number($iTime) If @error Then Return SetError(@error, 0, 0) $GRID_W = Int($JSON.Item("width") * $JSON.Item("tilewidth")) $GRID_H = Int($JSON.Item("height") * $JSON.Item("tileheight")) $GRID_WZ = $GRID_W * $GRID_ZOOM $GRID_HZ = $GRID_H * $GRID_ZOOM ReDim $aGrid[$GRID_W][$GRID_H] $GRID_GUI_HANDLE = GUICreate($sTitle, $GRID_WZ * $GRID_ZOOM, $GRID_HZ * $GRID_ZOOM, -1, -1, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST) _GDIPlus_Startup() If @error Then $hGDI = False $hGraphic = _GDIPlus_GraphicsCreateFromHWND($GRID_GUI_HANDLE) $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GRID_W, $GRID_H, $hGraphic) $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) $hBrush = _GDIPlus_BrushCreateSolid(0x00FFFFFF) $hPen = _GDIPlus_PenCreate() _GDIPlus_GraphicsClear($hBackbuffer) _GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2) __Grid_Build_Tilesets() __Grid_Build_Layers() If Not ($GRID_ZOOM == 1) Then $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixScale($hMatrix, $GRID_ZOOM, $GRID_ZOOM, True) _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix) EndIf $GRID_LIMIT_LEF = 0 $GRID_LIMIT_TOP = 0 $GRID_LIMIT_RIG = $JSON.Item("width") * $JSON.Item("tilewidth") - $JSON.Item("tilewidth") $GRID_LIMIT_BOT = $JSON.Item("height") * $JSON.Item("tileheight") - $JSON.Item("tileheight") GUISetState(@SW_SHOW, $GRID_GUI_HANDLE) GUISetOnEvent($GUI_EVENT_CLOSE, "__Grid_End") AdlibRegister("__Grid_Update", $iTime) EndFunc ;==>Grid_Create Func __Grid_Update() __Grid_Keyboard() _GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF) ;__Grid_Draw_Layers() _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hImage3, 0, 0, $GRID_W, $GRID_H) draw_wall() move_actors() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $GRID_WZ, $GRID_HZ) EndFunc ;==>__Grid_Update Func __Grid_Draw_Layers() _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hImage3, 0, 0, $GRID_W, $GRID_H) EndFunc ;==>__Grid_Draw_Layers Func __Grid_End() Exit EndFunc ;==>__Grid_End Func Grid_AddActor($iXX, $iYY, $iWidth, $iHeight, $iSpeed, $iColor) Local $id = $oActor.Count + 1 $oActor.Add($id, ObjCreate($SD)) $oActor.Item($id).Add("x", $iXX) $oActor.Item($id).Add("y", $iYY) $oActor.Item($id).Add("w", $iWidth) $oActor.Item($id).Add("h", $iHeight) $oActor.Item($id).Add("st", $iSpeed) $oActor.Item($id).Add("sx", $oActor.Item($id).Item("st") * $ROOT) $oActor.Item($id).Add("c", $iColor) $oActor.Item($id).Add("ll", 0) $oActor.Item($id).Add("lt", 0) $oActor.Item($id).Add("lr", $GRID_W - $iWidth) $oActor.Item($id).Add("lb", $GRID_H - $iHeight) EndFunc ;==>Grid_AddActor Func __Grid_OnExit() AdlibUnRegister("__Grid_Update") If Not ($hUser32 == -1) Then DllClose($hUser32) If $hGDI Then For $each In $oImage _GDIPlus_ImageDispose($oImage.Item($each).Item("handle")) Next For $each In $oTiles _GDIPlus_ImageDispose($oTiles.Item($each)) Next _GDIPlus_GraphicsDispose($hBackbuffer) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndIf GUIDelete($GRID_GUI_HANDLE) EndFunc ;==>__Grid_OnExit Func draw_wall() For $each In $oWall _box($hBackbuffer, _ $oWall.Item($each).Item("x"), _ $oWall.Item($each).Item("y"), _ $oWall.Item($each).Item("w"), _ $oWall.Item($each).Item("h"), _ $oWall.Item($each).Item("c")) Next EndFunc ;==>draw_wall Func grid_add_wall($xx, $yy, $iWW, $hh, $iColor) Local $oo = ObjCreate($SD) $oWall.Add($oWall.Count + 1, ObjCreate($SD)) $oWall.Item($oWall.Count).Add("x", $xx) $oWall.Item($oWall.Count).Add("y", $yy) $oWall.Item($oWall.Count).Add("w", $iWW) $oWall.Item($oWall.Count).Add("h", $hh) $oWall.Item($oWall.Count).Add("c", $iColor) For $ii = $xx To $xx + $iWW - 1 For $jj = $yy To $yy + $hh - 1 $aGrid[$ii][$jj] = $oWall.Count Next Next EndFunc ;==>grid_add_wall Func move($each) ;~ nw n ne ;~ w 0 e ;~ sw s se ;~ 32 3 34 ;~ 2 0 4 ;~ 52 5 54 $iWW = $aPress[2] And Not $aPress[4] ? True : False $iEE = $aPress[4] And Not $aPress[2] ? True : False $iNN = $aPress[3] And Not $aPress[5] ? True : False $iSS = $aPress[5] And Not $aPress[3] ? True : False $iNE = $iNN And $iEE ? True : False $iSE = $iSS And $iEE ? True : False $iSW = $iWW And $iSS ? True : False $iNW = $iWW And $iNN ? True : False Select Case $iNW __Grid_MoveX($each, 8) $iDir = 8 Case $iNE __Grid_MoveX($each, 2) $iDir = 2 Case $iSE __Grid_MoveX($each, 4) $iDir = 4 Case $iSW __Grid_MoveX($each, 6) $iDir = 6 Case Else Select Case $iNN __Grid_MoveT($each, 1, "st") Case $iEE __Grid_MoveT($each, 3, "st") Case $iSS __Grid_MoveT($each, 5, "st") Case $iWW __Grid_MoveT($each, 7, "st") Case Else __Grid_MoveT($each, 0, "st") EndSelect EndSelect EndFunc ;==>move Func walk() If $iDir Then $iWalk -= 1 If $iWalk < 0 Then $iWalk = 8 $iMov = $iDir EndIf EndFunc ;==>walk Func __Grid_MoveT($each, $dir, $speed) $iDir = $dir Switch $dir Case 1 ; NN $iEval = $oActor.Item($each).Item("y") - $oActor.Item($each).Item($speed) $iEval = $iEval <= $oActor.Item($each).Item("lt") ? $oActor.Item($each).Item("lt") : $iEval For $jj = $oActor.Item($each).Item("y") - 1 To $iEval Step -1 For $ii = $oActor.Item($each).Item("x") To $oActor.Item($each).Item("x") + $oActor.Item($each).Item("w") - 1 If $aGrid[$ii][$jj] Then $oActor.Item($each).Item("y") = $jj + 1 Return EndIf Next Next $oActor.Item($each).Item("y") = $iEval Case 3 ; EE / RIGHT $iEval = $oActor.Item($each).Item("x") + $oActor.Item($each).Item($speed) $iEval = $iEval >= $oActor.Item($each).Item("lr") ? $oActor.Item($each).Item("lr") : $iEval For $ii = $oActor.Item($each).Item("x") + $oActor.Item($each).Item("w") To $iEval + $oActor.Item($each).Item("w") - 1 For $jj = $oActor.Item($each).Item("y") To $oActor.Item($each).Item("y") + $oActor.Item($each).Item("h") - 1 If $aGrid[$ii][$jj] Then $oActor.Item($each).Item("x") = $ii - $oActor.Item($each).Item("w") Return EndIf Next Next $oActor.Item($each).Item("x") = $iEval Case 5 ; SS / DOWN $iEval = $oActor.Item($each).Item("y") + $oActor.Item($each).Item($speed) $iEval = $iEval >= $oActor.Item($each).Item("lb") ? $oActor.Item($each).Item("lb") : $iEval For $jj = $oActor.Item($each).Item("y") + $oActor.Item($each).Item("h") To $iEval + $oActor.Item($each).Item("h") - 1 For $ii = $oActor.Item($each).Item("x") To $oActor.Item($each).Item("x") + $oActor.Item($each).Item("w") - 1 If $aGrid[$ii][$jj] Then $oActor.Item($each).Item("y") = $jj - $oActor.Item($each).Item("h") Return EndIf Next Next $oActor.Item($each).Item("y") = $iEval Case 7 ; WW / LEFT $iEval = $oActor.Item($each).Item("x") - $oActor.Item($each).Item($speed) $iEval = $iEval <= $oActor.Item($each).Item("ll") ? $oActor.Item($each).Item("ll") : $iEval For $ii = $oActor.Item($each).Item("x") - 1 To $iEval Step -1 For $jj = $oActor.Item($each).Item("y") To $oActor.Item($each).Item("y") + $oActor.Item($each).Item("h") - 1 If $aGrid[$ii][$jj] Then $oActor.Item($each).Item("x") = $ii + 1 Return EndIf Next Next $oActor.Item($each).Item("x") = $iEval ;Case 0 EndSwitch EndFunc ;==>__Grid_MoveT Func __Grid_MoveX($each, $dir) Switch $dir Case 2 ; $iNE __Grid_MoveT($each, 1, "sx") __Grid_MoveT($each, 3, "sx") Case 4 ; $iSE __Grid_MoveT($each, 3, "sx") __Grid_MoveT($each, 5, "sx") Case 6 ; $iSW __Grid_MoveT($each, 5, "sx") __Grid_MoveT($each, 7, "sx") Case 8; $iNW __Grid_MoveT($each, 1, "sx") __Grid_MoveT($each, 7, "sx") EndSwitch EndFunc ;==>__Grid_MoveX Func __Grid_Keyboard() If Not $oActor.Count Then Return For $ii = 0 To 5 If _IsPressed($aKeys[$ii], $hUser32) And Not $aPress[$ii] Then $aPress[$ii] = True If Not _IsPressed($aKeys[$ii], $hUser32) And $aPress[$ii] Then $aPress[$ii] = False Next EndFunc ;==>__Grid_Keyboard Func move_actors() ;If Not $oActor.Count Then Return For $each In $oActor move($each) _box($hBackbuffer, Int($oActor.Item($each).Item("x")), Int($oActor.Item($each).Item("y")), $oActor.Item($each).Item("w"), $oActor.Item($each).Item("h"), $oActor.Item($each).Item("c")) Next Local $aa[9] = [0, 1, 2, 3, 7, 6, 5, 4, 0] If $iDir Then _GDIPlus_GraphicsDrawImageRectRect($hBackbuffer, $img, $iWalk * 28, $aa[$iDir] * 32 + 1, 32, 32, $oActor.Item($each).Item("x"), $oActor.Item($each).Item("y"), 32, 32) Else _GDIPlus_GraphicsDrawImageRectRect($hBackbuffer, $img, $iWalk * 28, $aa[$iMov] * 32 + 1, 32, 32, $oActor.Item($each).Item("x"), $oActor.Item($each).Item("y"), 32, 32) EndIf ;WinSetTitle($GRID_GUI_HANDLE, "", "x[" & $oActor.Item($each).Item("x") & "] y[" & $oActor.Item($each).Item("y") & "]") EndFunc ;==>move_actors Func _box($hToGraphic, $iXX, $iYY, $iWW, $iHH, $iColor = 0) ; _box3 If $iWW = 1 And $iHH = 1 Then If $iColor Then _GDIPlus_BrushSetSolidColor($hBrush, $iColor) _GDIPlus_GraphicsFillRect($hBackbuffer, $iXX, $iYY, $iWW, $iHH, $hBrush) Else _GDIPlus_GraphicsFillRect($hBackbuffer, $iXX, $iYY, $iWW, $iHH) EndIf Else Local $aBox[5][2] $aBox[0][0] = 4 $aBox[1][0] = $iXX $aBox[1][1] = $iYY $aBox[2][0] = $iXX + $iWW - 1 $aBox[2][1] = $iYY $aBox[3][0] = $iXX + $iWW - 1 $aBox[3][1] = $iYY + $iHH - 1 $aBox[4][0] = $iXX $aBox[4][1] = $iYY + $iHH - 1 If $iColor Then _GDIPlus_PenSetColor($hPen, $iColor) _GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox, $hPen) Else _GDIPlus_GraphicsDrawPolygon($hToGraphic, $aBox) EndIf EndIf EndFunc ;==>_box Func Grid_LoadFile($sFilePath = "") If Not $sFilePath Then Return SetError(1, 0, 0) Local $hFile = FileOpen($sFilePath) If Not $hFile Or @error Then Return SetError(2, 0, 0) Local $sJson = FileRead($hFile) ;ConsoleWrite($sJson & @LF) If @error Or Not $sJson Then Return SetError(3, 0, 0) $sJson = Jsmn_Decode($sJson) If @error Or Not IsDictionary($sJson) Then Return SetError(4, 0, 0) If Not (Number($sJson.Item("version")) == 1) Then Return SetError(5, 0, 0) If Not ($sJson.Item("orientation") == "orthogonal") Then Return SetError(6, 0, 0) Return $sJson EndFunc ;==>Grid_LoadFile Func __Grid_Load_Image($sPath = "") If Not FileExists($sPath) Then Return SetError(1, 0, 0) Local $hImage = _GDIPlus_ImageLoadFromFile($sPath) If @error Then Return SetError(2, 0, 0) $oImage.Add($sPath, ObjCreate($SD)) $oImage.Item($sPath).Add("handle", $hImage) $oImage.Item($sPath).Add("w", _GDIPlus_ImageGetWidth($hImage)) $oImage.Item($sPath).Add("h", _GDIPlus_ImageGetHeight($hImage)) Return $hImage EndFunc ;==>__Grid_Load_Image Func __Grid_Build_Tiles($iFirstGid, $sPath, $iImageHeight, $iImageWidth, $iTileHeight, $iTileWidth, $iTranparency, $iMargin, $iSpacing, $sName) ;ConsoleWrite("__Grid_Build_Tiles($iFirstGid[" & $iFirstGid & "], $sPath[" & $sPath & "], $iImageHeight, $iImageWidth, $iTileHeight, $iTileWidth, $iTranparency, $iMargin, $iSpacing, $sName)" & @LF) Local $hImage = _GDIPlus_ImageLoadFromFile($sPath) If @error Then Exit Local $hBitmap, $hBmpCtxt For $jj = 0 To ($iImageHeight / ($iTileHeight + $iSpacing)) - 1 For $ii = 0 To ($iImageWidth / ($iTileWidth + $iMargin)) - 1 $hBitmap = _GDIPlus_BitmapCreateFromScan0($iTileWidth, $iTileHeight) $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hBmpCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;_GDIPlus_GraphicsClear($hBmpCtxt, 0xFF000000) ;_GDIPlus_GraphicsClear($hBmpCtxt, 0xFFFFFFFF) _GDIPlus_GraphicsClear($hBmpCtxt, 0x00FFFFFF) _GDIPlus_GraphicsDrawImageRectRect( _ $hBmpCtxt, _ $hImage, _ $iMargin + $ii * ($iTileWidth + $iSpacing), _ $iMargin + $jj * ($iTileHeight + $iSpacing), _ $iTileWidth, _ $iTileHeight, _ 0, _ 0, _ $iTileWidth, _ $iTileHeight _ ) $oTiles.Add($iFirstGid, $hBitmap) ;_GDIPlus_ImageSaveToFile($hBitmap, "C:\Dropbox\ARPC\teste\" & $iFirstGid & ".png") $iFirstGid += 1 _GDIPlus_GraphicsDispose($hBmpCtxt) Next Next ;_GDIPlus_BitmapDispose($hBitmap) ;dump($oTiles) EndFunc ;==>__Grid_Build_Tiles Func __Grid_NewImage($iImageWidth, $iImageHeight) Local $hImage = _GDIPlus_BitmapCreateFromScan0($iImageWidth, $iImageHeight) Local $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hBmpCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsClear($hBmpCtxt, 0x00FFFFFF) Return $hBmpCtxt EndFunc ;==>__Grid_NewImage Func __Grid_Build_Tilesets() Local $oo = $JSON.Item("tilesets") For $each In $oo __Grid_Build_Tiles( _ Number($each.Item("firstgid")), _ String($each.Item("image")), _ Number($each.Item("imageheight")), _ Number($each.Item("imagewidth")), _ Number($each.Item("tileheight")), _ Number($each.Item("tilewidth")), _ $each.Item("transparentcolor"), _ Number($each.Item("margin")), _ Number($each.Item("spacing")), _ String($each.Item("name")) _ ) Next EndFunc ;==>__Grid_Build_Tilesets Func __Grid_Build_Layers() Local $aLayers = $JSON.Item("layers") Local $aData, $sName, $iTile Local $xx = 0, $yy = 0 $hImage3 = _GDIPlus_BitmapCreateFromScan0($GRID_W, $GRID_H) $hBmpCtxt3 = _GDIPlus_ImageGetGraphicsContext($hImage3) _GDIPlus_GraphicsSetSmoothingMode($hBmpCtxt3, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsClear($hBmpCtxt3, 0x00FFFFFF) For $ii = 0 To UBound($aLayers, 1) - 1 $aData = $JSON.Item("layers")[$ii].Item("data") $sName = $JSON.Item("layers")[$ii].Item("name") For $jj = 0 To UBound($aData, 1) - 1 $iTile = $aData[$jj] If $iTile Then ;ConsoleWrite("$sName[" & $sName & "] $iTile[" & $iTile & "] $ii[" & $ii & "] $jj[" & $jj & "] $aData[" & $aData[$jj] & "]{" & $oTiles.Item($aData[$jj]).Item("handle") & "}" & @LF) ;ConsoleWrite("x[" & $xx & "] y[" & $yy & "] sName[" & $sName & "] iTile[" & $iTile & "]" & @LF) _GDIPlus_GraphicsDrawImageRectRect( _ $hBmpCtxt3, _ $oTiles.Item($iTile), _ ; $oTiles.Item($sName).Item($iTile) 0, _ 0, _ 32, _ 32, _ $xx * (32), _ $yy * (32), _ 32, _ 32 _ ) ;_GDIPlus_ImageSaveToFile($hImage3, "C:\Dropbox\ARPC\teste\name" & $sName & "_tile" & $iTile & "_x" & $xx & "_y" & $yy & ".png") EndIf $xx += 1 If $xx >= $JSON.Item("width") Then $xx = 0 $yy += 1 EndIf Next $xx = 0 $yy = 0 ;_GDIPlus_ImageSaveToFile($hImage3, "C:\Dropbox\ARPC\teste\" & $sName & "_" & $ii & ".png") Next EndFunc ;==>__Grid_Build_Layers Func dump($oo, $key = "", $iIdent = 0) Local $iTab = 4 Local $sKeys If IsDictionary($oo) Then $sKeys = $oo.Keys For $each In $sKeys If IsDictionary($oo.Item($each)) Or IsArray($oo.Item($each)) Then ConsoleWrite(($iIdent == 0 ? "" : (_StringRepeat(" ", $iIdent))) & $each & "{" & @LF) dump($oo.Item($each), ($key == "" ? "" : $key & ".") & $each, $iTab + $iIdent) ConsoleWrite(($iIdent == 0 ? "" : (_StringRepeat(" ", $iIdent))) & "}" & @LF) Else ConsoleWrite(($iIdent == 0 ? "" : (_StringRepeat(" ", $iIdent))) & ($key == "" ? "" : $key & ".") & $each & " = " & $oo.Item($each) & @LF) EndIf Next Else If IsArray($oo) Then Switch UBound($oo, 0) Case 1 For $ii = 0 To UBound($oo, 1) - 1 If IsDictionary($oo[$ii]) Or IsArray($oo[$ii]) Then dump($oo[$ii], $key & "[" & $ii & "]", $iTab + $iIdent) Else ConsoleWrite(($iIdent == 0 ? "" : (_StringRepeat(" ", $iIdent))) & ($key == "" ? "" : $key & "[") & $ii & "] = " & $oo[$ii] & @LF) EndIf Next Case 2 For $ii = 0 To UBound($oo, 1) - 1 For $jj = 0 To UBound($oo, 2) - 1 If IsDictionary($oo[$ii][$jj]) Or IsArray($oo[$ii][$jj]) Then dump($oo[$ii][$jj], $key & "[" & $ii & "][" & $jj & "]", $iTab + $iIdent) Else ConsoleWrite(($iIdent == 0 ? "" : (_StringRepeat(" ", $iIdent))) & ($key == "" ? "" : $key & "[") & $ii & "][" & $jj & "] = " & $oo[$ii][$jj] & @LF) EndIf Next Next EndSwitch Else EndIf EndIf EndFunc ;==>dump Func IsDictionary($oo = Null) If Not IsObj($oo) Or Not (ObjName($oo, 2) == "Scripting.Dictionary") Then Return SetError(1, 0, False) Return True EndFunc ;==>IsDictionary Func _ErrFunc($oError) ; Do anything here. ConsoleWrite("err.number is: " & @TAB & $oError.number & @CRLF & _ "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ "err.description is: " & @TAB & $oError.description & @CRLF & _ "err.source is: " & @TAB & $oError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF) EndFunc ;==>_ErrFunc