Leaderboard
Popular Content
Showing content with the highest reputation on 10/13/2018 in all areas
-
Here is my ErrorLog.au3 UDF which I use every day. ErrorLog.au3 UDF is for log program activities and errors, to different output with possibility to switch output function instantly. UDF: #include-once #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #Tidy_Parameters=/sort_funcs /reel ; #AutoIt3Wrapper_Run_Debug_Mode=Y Global $__g_bUDF_ERRORLOG_FORCE_DEBUG = False Global $__g_sUDF_ERRORLOG_PREFIX = '--> ' Global $__g_sUDF_ERRORLOG_PREFIX_SUCCESS = '+ ' Global $__g_sUDF_ERRORLOG_PREFIX_EXTENDED = '- ' Global $__g_sUDF_ERRORLOG_PREFIX_ERROR = '! ' #Region ErrorLog.au3 - UDF Header ; #INDEX# ======================================================================================================================= ; Title .........: ErrorLog.au3 UDF - A logging Library ; AutoIt Version : 3.3.10.2++ ; Language ......: English ; Description ...: ErrorLog.au3 UDF is for log program activities and errors, to different output with possibility to switch output function instantly ; Author(s) .....: mLipok ; Modified ......: ; URL ...........: https://www.autoitscript.com/forum/topic/195882-errorlogau3-a-logging-library/ ; =============================================================================================================================== #cs UDF ChangeLog 2018/10/11 v1.0 * Added: UDF #INDEX# - mLipok * Added: UDF ChangeLog - mLipok * Added: Function: _Log_Errors_Reset() - mLipok * Renamed: Function: _Log_Errors() >> _Log_OnError() - mLipok * Changed: Function: better documentation in function headers - mLipok * Added: ErrorLog__Example.au3 - _Log_Example_1() , _Log_Example_2(), _Log_Example_3() - mLipok 2018/10/12 v1.1 * Added: Function: __Log_Wrapper() - a wrapper which put report to the output function - mLipok * Changed: Function: _Log_SetOutputFunction(Default) - return only function in any other case fires @error - mLipok * Refactored: Function: _Log() - mLipok * Refactored: Function: _Log_OnError() - mLipok * Added: GLOBAL: $__g_bUDF_ERRORLOG_FORCE_DEBUG - mLipok * Added: GLOBAL: $__g_sUDF_ERRORLOG_PREFIX_EXTENDED - mLipok * Added: GLOBAL: $__g_sUDF_ERRORLOG_PREFIX_SUCCESS - mLipok * Changed: GLOBAL: $__g_sUDF_ERRORLOG_ERROR_PREFIX >> $__g_sUDF_ERRORLOG_PREFIX_ERROR - mLipok * Added: Function: _Log_OnSuccess() - Log report to the output function but only if @error was not fired - mLipok * Added: Function: _Log_OnExtended() - Log report to the output function but only if @extended is set and @error was not fired - mLipok * Added: Function: _Log_Debug() - Log report to the output function but only if _Log_SetDebugMode(True) was used - mLipok * Added: Function: _Log_SetDebugMode() - Set the _Log_Debug() ON/OFF - mLipok * Changed: Function: much better documentation in function headers - mLipok * Added: UDF: #Region <> #EndRegion - mLipok * Added: UDF: #Tidy_Parameters=/sort_funcs /reel * Added: ErrorLog__Example.au3 - $__g_bUDF_ERRORLOG_FORCE_DEBUG - _Log_SetDebugMode() - mLipok * Added: ErrorLog__Example.au3 - _Log_Debug() - mLipok @LAST CHANGE LOG #ce UDF ChangeLog #EndRegion ErrorLog.au3 - UDF Header #Region ErrorLog.au3 - Functions ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log ; Description ...: Log report to the output function ; Syntax ........: _Log($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: This function will not send log reports to output if _Log_SetOutputFunction() is not properly set ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log($sText = '', $iError = @error, $iExtended = @extended) __Log_Wrapper( _ (($iError Or $iExtended) ? ($__g_sUDF_ERRORLOG_PREFIX_ERROR & '[ ' & $iError & ' / ' & $iExtended & ' ] : ') : ($__g_sUDF_ERRORLOG_PREFIX)) _ & $sText _ ) Return SetError($iError, $iExtended) EndFunc ;==>_Log ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_Change ; Description ...: Log report to the output function but only if @error or @extended occurs OR if reported data has changed ; Syntax ........: _Log_Change([$sText = ''[, $iError = @error[, $iExtended = @extended]]]) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; $iError - [optional] an integer value. Default is @error. ; $iExtended - [optional] an integer value. Default is @extended. ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: This function will not send log reports to output if there is no change and no message, or if _Log_SetOutputFunction() is not properly set ; Related .......: _Log ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_Change($sText = '', $iError = @error, $iExtended = @extended) Local Static $sText_static = '' Local Static $iError_static = 0 Local Static $iExtended_static = 0 If $sText <> '' Or $iError Or $iExtended And _ ($sText_static <> $sText Or $iError_static <> $iError Or $iExtended_static <> $iExtended) _ Then _Log($sText, $iError, $iExtended) $sText_static = $sText $iError_static = $iError $iExtended_static = $iExtended EndIf Return SetError($iError, $iExtended) EndFunc ;==>_Log_Change ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_Debug ; Description ...: Log report to the output function but only if _Log_SetDebugMode(True) was used ; Syntax ........: _Log_Debug($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: This function will not send log reports to output if _Log_SetOutputFunction() is not properly set ; Related .......: _Log ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_Debug($sText, $iScriptLineNumber = @ScriptLineNumber, $iError = @error, $iExtended = @extended) If $__g_bUDF_ERRORLOG_FORCE_DEBUG == True Then __Log_Wrapper('@@ Debug(' & $iScriptLineNumber & ') : [ ' & $iError & ' / ' & $iExtended & ' ] : ' & $sText) Return SetError($iError, $iExtended) EndFunc ;==>_Log_Debug ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_Errors_Reset ; Description ...: Resetting @error and @extended to 0 ; Syntax ........: _Log_Errors_Reset() ; Parameters ....: None ; Return values .: None - and set @error and @extended to 0 ; Author ........: mLipok ; Modified ......: ; Remarks .......: this is only wrapper for SetError(0, 0) ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_Errors_Reset() Return SetError(0, 0) EndFunc ;==>_Log_Errors_Reset ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_Errors_ReStore ; Description ...: Restore previously stored @error and @extended ; Syntax ........: _Log_Errors_ReStore() ; Parameters ....: None ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: _Log_Errors_Store ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_Errors_ReStore() _Log_Errors_Store(Default, Default) Return SetError(@error, @extended) EndFunc ;==>_Log_Errors_ReStore ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_Errors_Store ; Description ...: Store @error and @extended ; Syntax ........: _Log_Errors_Store([$iError = @error[, $iExtended = @extended]]) ; Parameters ....: $iError - [optional] an integer value. Default is @error. ; $iExtended - [optional] an integer value. Default is @extended. ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: _Log_Errors_ReStore ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_Errors_Store($iError = @error, $iExtended = @extended) Local Static $iError_static = 0, $iExtended_static = 0 If $iError = Default And $iExtended = Default Then $iError = $iError_static $iExtended = $iExtended_static $iError_static = 0 $iExtended_static = 0 Return SetError($iError, $iExtended) EndIf $iError_static = $iError $iExtended_static = $iExtended Return SetError($iError, $iExtended) EndFunc ;==>_Log_Errors_Store ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_OnError ; Description ...: Log report to the output function but only if @error occurs ; Syntax ........: _Log_OnError($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: This function will not send log reports to output if _Log_SetOutputFunction() is not properly set ; Related .......: _Log ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_OnError($sText, $iError = @error, $iExtended = @extended) If $iError Then __Log_Wrapper($__g_sUDF_ERRORLOG_PREFIX_ERROR & '@error=' & $iError & ' @extended=' & $iExtended & ' :: ' & $sText) Return SetError($iError, $iExtended) EndFunc ;==>_Log_OnError ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_OnExtended ; Description ...: Log report to the output function but only if @extended is set and @error was not fired - mLipok ; Syntax ........: _Log_OnExtended($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: This function will not send log reports to output if _Log_SetOutputFunction() is not properly set ; Related .......: _Log ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_OnExtended($sText, $iError = @error, $iExtended = @extended) If $iExtended And $iError = 0 Then __Log_Wrapper($__g_sUDF_ERRORLOG_PREFIX_EXTENDED & '[ ' & $iError & ' / ' & $iExtended & ' ] : ' & $sText) Return SetError($iError, $iExtended) EndFunc ;==>_Log_OnExtended ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_OnSuccess ; Description ...: Log report to the output function but only if @error was not fired ; Syntax ........: _Log_OnSuccess($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: None - and set @error and @extended to stored values ; Author ........: mLipok ; Modified ......: ; Remarks .......: This function will not send log reports to output if _Log_SetOutputFunction() is not properly set ; Related .......: _Log ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_OnSuccess($sText, $iError = @error, $iExtended = @extended) If $iError = 0 Then __Log_Wrapper($__g_sUDF_ERRORLOG_PREFIX_SUCCESS & '[ ' & $iError & ' / ' & $iExtended & ' ] : ' & $sText) Return SetError($iError, $iExtended) EndFunc ;==>_Log_OnSuccess ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_SetDebugMode ; Description ...: Set the _Log_Debug() ON/OFF ; Syntax ........: _Log_SetOutputFunction($bForceDebug) ; Parameters ....: $bForceDebug - a boolean value. True=ON, False=OFF for _Log_Debug() ; Return values .: none or set @error to 1 ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: _Log_Debug ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_SetDebugMode($bForceDebug) If Not IsBool($bForceDebug) Then Return SetError(1) $__g_bUDF_ERRORLOG_FORCE_DEBUG = $bForceDebug EndFunc ;==>_Log_SetDebugMode ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_SetOutputFunction ; Description ...: Set the function to which Log reports should be passed ; Syntax ........: _Log_SetOutputFunction([$fnFunction = Default]) ; Parameters ....: $fnFunction - [optional] a floating point value. Default is Default. ; Return values .: $fnFunction_static - saved output function, in any other case fires @error ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_SetOutputFunction($fnFunction = Default) Local Static $fnFunction_static = Null If $fnFunction = Default And IsFunc($fnFunction_static) Then Return $fnFunction_static If Not IsFunc($fnFunction) Then Return SetError(1) $fnFunction_static = $fnFunction Return $fnFunction_static EndFunc ;==>_Log_SetOutputFunction #EndRegion ErrorLog.au3 - Functions #Region ErrorLog.au3 - Internal Functions ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __Log_Wrapper ; Description ...: a wrapper which put report to the output function ; Syntax ........: __Log_Wrapper($sText) ; Parameters ....: $sText - a string value. Textual data which should be reported to the output function ; Return values .: None or set @error = 1 in case _Log_SetOutputFunction() was not used or used not properly ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: _Log, _Log_OnError, _Log_OnExtended, _Log_OnSuccess, _Log_Change ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func __Log_Wrapper($sText) Local $fnFunction = _Log_SetOutputFunction() If @error Then Return SetError(1) $fnFunction($sText) EndFunc ;==>__Log_Wrapper #EndRegion ErrorLog.au3 - Internal Functions EXAMPLE: #include <WinAPIProc.au3> #include-once #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ; #AutoIt3Wrapper_Run_Debug_Mode=Y ; #Tidy_Parameters=/sort_funcs /reel #include <Debug.au3> #include "ErrorLog.au3" If Not @Compiled Then $__g_bUDF_ERRORLOG_FORCE_DEBUG = True ; Pre set function to where log report is passed _Log_SetOutputFunction(ConsoleWrite) _Log_Debug("EXAMPLE 1: START" & @CRLF, @ScriptLineNumber) _Log_Example_1() ; check again for @error If @error Then MsgBox($MB_ICONERROR, 'Example 1: Error Occured', _ 'File Reading Problem.' & @CRLF & _ '@error = ' & @error & @CRLF & _ '@extended = ' & @extended _ ) _Log_Debug("EXAMPLE 2: START" & @CRLF, @ScriptLineNumber) _Log_Example_2() _Log_Debug("EXAMPLE 3: START", @ScriptLineNumber) _Log_Example_3() _Log_SetOutputFunction(_ConsoleWrite_Wrapper) _Log_Debug("EXAMPLES: END", @ScriptLineNumber) Func _Log_Example_1() ; sending description to log output _Log('Example 1: We are trying to read file.' & @CR) ; fire @error FileRead('FILE PATH WHICH NOT EXIST') ; report @error but do not change it - store it and back it again _Log_OnError('Example 1: File Reading Problem.' & @CR) Return SetError(@error, @extended) EndFunc ;==>_Log_Example_1 Func _Log_Example_2() ; set function to where log reports will be passed _Log_SetOutputFunction(_ConsoleWrite_Wrapper) ; sending description to log output _Log('Example 2: We are trying to read file.') For $iAttempt_idx = 1 To 15 _log('Example 2: $iAttempt_idx = ' & $iAttempt_idx) ; fire @error If $iAttempt_idx < 14 Then FileRead('FILE PATH WHICH NOT EXIST') ; next line will log only in step #12 and #13 - as only to step #13 , errors ocurrs If $iAttempt_idx > 11 Then _Log_OnError('Example 2: File Reading error' & @CR) ; fake @error to show what _Log_Change() will do when @error is changing If $iAttempt_idx = 5 Then SetError(2) ; fake @exteneded to show what _Log_Change() will do when @exteneded is changing If $iAttempt_idx = 10 Then SetError(@error, 2) ; string change If $iAttempt_idx > 13 Then _Log_Change('Some other log data') ; report to log output but only first unique occurance _Log_Change('Example 2: File Reading Problem.' & @CR) _Log_Errors_Reset() ; if you do not reset then @error and @extended could be followed to next loop. Next EndFunc ;==>_Log_Example_2 Func _Log_Example_3() ; set function to where log reports will be passed _Log_SetOutputFunction(_ConsoleWrite_Wrapper) ; sending description to log output _Log('Example 3: We are trying to read file.') For $iAttempt_idx = 1 To 15 ; If $iAttempt_idx = 9 change output function - from this moment log reports will be passed to _DebugOut() instead _ConsoleWrite_Wrapper() If $iAttempt_idx = 9 Then _DebugSetup("Example 3: ErrorLog.au3 - output") _Log_SetOutputFunction(_DebugOut) EndIf _log('Example 3: $iAttempt_idx = ' & $iAttempt_idx) ; fire @error If $iAttempt_idx < 14 Then FileRead('FILE PATH WHICH NOT EXIST') ; next line will log only in step #12 and #13 - as only to step #13 , errors ocurrs If $iAttempt_idx > 11 Then _Log_OnError('Example 3: File Reading error') ; fake @error to show what _Log_Change() will do when @error is changing If $iAttempt_idx = 5 Then SetError(2) ; fake @exteneded to show what _Log_Change() will do when @exteneded is changing If $iAttempt_idx = 10 Then SetError(@error, 2) ; string change If $iAttempt_idx > 13 Then _Log_Change('Example 3: Some other log data') ; report to log output but only first unique occurance _Log_Change('Example 3: File Reading Problem.' & @CR) _Log_Errors_Reset() ; if you do not reset then @error and @extended could be followed to next loop. Next EndFunc ;==>_Log_Example_3 Func _ConsoleWrite_Wrapper($sData) ConsoleWrite($sData & @CRLF) EndFunc ;==>_ConsoleWrite_Wrapper REMARKS: Documentation in function headers is currently complete1 point
-
UIAutomation in itself out of the box from Microsoft is in general fast. If you give the proper identification string it will work fast with the wrappers If you do not give a proper identification a "smart" uia wrapper algorithm tries to find your element anyway. So its a choice between slow finding your object of interest or failing directly If you have bad luck it will fully search your full desktop and all (sub)windows which will offcourse be terrible when html elements are around When you see deep find in your log its probably smart to have additional setfocus actions and/or look at your expression for identifying Ideas for smarter fallback algorithm are allways welcome rti.mainwindow and rti.parent are important parts for the algoritm in fallback searching In general the hierarchy of your object you can see with simplespy Desktop Window 1 Window 2 Group element your element A Group element Group element Group element B If you directly try: _UIA_Action("Title:=B","click") If will start searching from desktop and indirectly hit all open windows and its childs so in above when window 1 is a browser its traversing all html elements before it goes to window 2. Below would probably already speedup as you first put focus to mainwindow with a UIA function (mixing with AutoIt standard funtions is in general not a good way to start) #include "UIAWrappers.au3" ShellExecute ("Appwiz.cpl") $Window = WinWaitActive ("Programmes et fonctionnalités") If WinExists ($Window) Then _UIA_setVar("my program.mainwindow","Title:="Programmes et fonctionnalités") _UIA_setVar("oUIElement","Title:=Zone de recherche;controltype:=UIA_EditControlTypeId;class:=SearchEditBox") ;ControlType:=UIA_EditControlTypeId;classname:=SearchEditBox") _UIA_action("my program.mainwindow","highlight") _UIA_action("my program.mainwindow","setfocus") _UIA_action("oUIElement","highlight") _UIA_action("oUIElement","settextvalue" , "test settextvalue") _UIA_action("oUIElement","setvalue" , "test setvalue")1 point
-
fabio123, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help. See you soon with a legitimate question I hope. M231 point
-
Can you this guy, How do it - (Moved)
FrancescoDiMuro reacted to careca for a topic
That's funny, how about some effort on your part?1 point -
ErrorLog.au3 UDF - A logging Library
argumentum reacted to Danyfirex for a topic
it's still relatively short. About 100 lines without functions header. long does not steal elegance. Saludos1 point -
This changes a single digit "n", into a double digit "0n", when the single digit is in any date format. Local $aDate[] = ["2010/9/1", "2010/9/18", "10/9/2018", "1/9/2018", "1/09/2018", "1-9-2018", "01.9.2018", "01 9 2018"] For $i = 0 To UBound($aDate) - 1 ;$date = StringRegExpReplace($aDate[$i], "(?<=\b)(\d)(?=\b)", "0${1}") ; The RE pattern captures a single digit that is between "word" boundaries. ; See mikell's post: https://www.autoitscript.com/forum/topic/196083-date-day-displays-1-integer-instead-of-2/?do=findComment&comment=1406276 $date = StringRegExpReplace($aDate[$i], "\b(\d)\b", "0${1}") ; The RE pattern captures a single digit that is between "word" boundaries. ConsoleWrite($aDate[$i] & @TAB & " = " & $date & @CRLF) Next #cs ; Returns:- 2010/9/1 = 2010/09/01 2010/9/18 = 2010/09/18 10/9/2018 = 10/09/2018 1/9/2018 = 01/09/2018 1/09/2018 = 01/09/2018 1-9-2018 = 01-09-2018 01.9.2018 = 01.09.2018 01 9 2018 = 01 09 2018 #ce1 point
-
Finally I end with this following example: #include <MsgBoxConstants.au3> #include <WinAPIProc.au3> _Example() Func _Example() ; disable ScreenSaver and other windows sleep features _WinAPI_SetThreadExecutionState(BitOR($ES_DISPLAY_REQUIRED, $ES_CONTINUOUS, $ES_SYSTEM_REQUIRED, $ES_AWAYMODE_REQUIRED)) MsgBox($MB_OK, 'Testing', 'Close this tester window when you be sure that your ScreeSaver not runing.') ; back to normal windows behavior _WinAPI_SetThreadExecutionState($ES_CONTINUOUS) EndFunc ;==>_Example Already added to HelpFile - should be available along with one of the future versions of AutoIt.1 point
-
Date, day displays 1 integer instead of 2
FrancescoDiMuro reacted to mikell for a topic
You might use something like this, to be sure that month and day are always 2 digits long $date = "10/9/2018" $tmp = StringSplit($date, "/") $date = StringFormat("%02i/%02i", $tmp[1], $tmp[2]) & "/"& $tmp[3] Msgbox(0,"", $date) Edit : The same, using a regex $date = "10/9/2018" $date = Execute("'" & StringRegExpReplace($date, "^(\d+)/(\d+)", "' & StringFormat('%02i', '$1') & '/' & StringFormat('%02i', '$2') & '") & "'") Msgbox(0,"", $date)1 point