Kidney Posted December 3, 2013 Share Posted December 3, 2013 So im trying to find todays date inside of stings that are in an array that I pulled from some table on a website for my work. here is the code I am using to try and find the date inside the strings that are stored in an array. Below is the output I get in the console. $Date = String(@MON & "/" & @MDAY & "/" & @YEAR) ConsoleWrite($Date & @CRLF) ;ConsoleWrite(UBound($aTableData) & @CRLF & UBound($aTableData, 2) & @CRLF) For $i = 1 to UBound($aTableData) - 1 ;ConsoleWrite(@CRLF & @CRLF & $aTableData[$i][1] & @CRLF & @CRLF) $sData = String($aTableData[$i][1]) ConsoleWrite($sData & @CRLF & @CRLF) $result = StringInStr($sData, $Date) If $result > 0 Then ConsoleWrite("~~~~~~~~~~~~~~~~~~~~~~~" & $i & @CRLF) Next expandcollapse popup12/03/2013 Please Wait... Round: 1301 Visit: Sunday - 11/3/2013 Start Time: Shift: 4:00PM- 8:00PM Please Wait... Round: 1348 Visit: Saturday - 11/23/2013 Start Time: Shift: 5:00PM- 9:00PM Please Wait... Round: 1348 Visit: Monday - 11/25/2013 Start Time: Shift: 11:45AM- 8:00PM Please Wait... Round: 1348 Visit: Tuesday - 11/26/2013 Start Time: Shift: 11:45AM- 8:00PM Please Wait... Round: 1348 Visit: Wednesday - 11/27/2013 Start Time: Shift: 2:00PM- 10:00PM Please Wait... Round: 1349 Visit: Saturday - 11/30/2013 Start Time: Shift: 4:00PM- 9:00PM Please Wait... Round: 1349 Visit: Monday - 12/2/2013 Start Time: Shift: 11:45AM- 8:15PM Please Wait... Round: 1349 Visit: Tuesday - 12/3/2013 Start Time: Shift: 11:45AM- 8:15PM Please Wait... Round: 1349 Visit: Friday - 12/6/2013 Start Time: Shift: 4:00PM- 9:00PM Please Wait... Round: 1350 Visit: Saturday - 12/7/2013 Start Time: Shift: 4:00PM- 9:00PM Please Wait... Round: 1350 Visit: Monday - 12/9/2013 Start Time: Shift: 11:45AM- 8:15PM Please Wait... Round: 2013 Visit: Sunday - 4/7/2013 Start Time: Shift: - Please Wait... Round: 13481 Visit: Friday - 11/29/2013 Start Time: Shift: 3:00PM- 9:00PM Link to comment Share on other sites More sharing options...
JohnOne Posted December 3, 2013 Share Posted December 3, 2013 Looks good. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Solution BrewManNH Posted December 3, 2013 Solution Share Posted December 3, 2013 You're looking for 12/03/2013, but the file has 12/3/2013, one of these is not like the other. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
guinness Posted December 3, 2013 Share Posted December 3, 2013 $Date = String(@MON & "/" & @MDAY & "/" & @YEAR) is already a string, so just use $Date = @MON & "/" & @MDAY & "/" & @YEAR. There is also no need for the other string function. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
JohnOne Posted December 3, 2013 Share Posted December 3, 2013 Must have missed the source file, has the OP removed it? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
BrewManNH Posted December 3, 2013 Share Posted December 3, 2013 The second window shows what's in the file itself, going by what the script is supposed to output to the console. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
kylomas Posted December 3, 2013 Share Posted December 3, 2013 Kidney, one way to do it... expandcollapse popuplocal $aTableData[100] = [ _ 'Please Wait... Round: 1301', _ ' Visit: Sunday - 11/3/2013', _ ' Start Time: Shift: 4:00PM- 8:00PM', _ 'Please Wait... Round: 1348', _ ' Visit: Saturday - 11/23/2013', _ ' Start Time: Shift: 5:00PM- 9:00PM', _ 'Please Wait... Round: 1348', _ ' Visit: Monday - 11/25/2013', _ ' Start Time: Shift: 11:45AM- 8:00PM', _ 'Please Wait... Round: 1348', _ ' Visit: Tuesday - 11/26/2013', _ ' Start Time: Shift: 11:45AM- 8:00PM', _ 'Please Wait... Round: 1348', _ ' Visit: Wednesday - 11/27/2013', _ ' Start Time: Shift: 2:00PM- 10:00PM', _ 'Please Wait... Round: 1349', _ ' Visit: Saturday - 11/30/2013', _ ' Start Time: Shift: 4:00PM- 9:00PM', _ 'Please Wait... Round: 1349', _ ' Visit: Monday - 12/2/2013', _ ' Start Time: Shift: 11:45AM- 8:15PM', _ 'Please Wait... Round: 1349', _ ' Visit: Tuesday - 12/3/2013', _ ' Start Time: Shift: 11:45AM- 8:15PM', _ 'Please Wait... Round: 1349', _ ' Visit: Friday - 12/6/2013', _ ' Start Time: Shift: 4:00PM- 9:00PM', _ 'Please Wait... Round: 1350', _ ' Visit: Saturday - 12/7/2013', _ ' Start Time: Shift: 4:00PM- 9:00PM', _ 'Please Wait... Round: 1350', _ ' Visit: Monday - 12/9/2013', _ ' Start Time: Shift: 11:45AM- 8:15PM', _ 'Please Wait... Round: 2013', _ ' Visit: Sunday - 4/7/2013', _ ' Start Time: Shift: -', _ 'Please Wait... Round: 13481', _ ' Visit: Friday - 11/29/2013', _ ' Start Time: Shift: 3:00PM- 9:00PM'] local $Date = @MON & "/" & @MDAY & "/" & @YEAR, $tdate, $atdate ConsoleWrite($Date & @CRLF) For $i = 1 to UBound($aTableData) - 1 $tdate = stringregexp($aTableData[$i],'\d{1,2}/\d{1,2}/\d{4}',3) if not @error then $atdate = stringsplit($tdate[0],'/') $tdate[0] = stringformat('%02s/%02s/%04s',$atdate[1],$atdate[2],$atdate[3]) if $tdate[0] = $date then ConsoleWrite('! hit for date = ' & $tdate[0] & @LF) endif next kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Kidney Posted December 3, 2013 Author Share Posted December 3, 2013 (edited) You're looking for 12/03/2013, but the file has 12/3/2013, one of these is not like the other. silly mistake..... added a switch statement to change it from a double digit output to a single digit for 1-9. final result: Local $MDAY Switch @MDAY Case 01 $MDAY = "1" Case 02 $MDAY = "2" Case 03 $MDAY = "3" Case 04 $MDAY = "4" Case 05 $MDAY = "5" Case 06 $MDAY = "6" Case 07 $MDAY = "7" Case 08 $MDAY = "8" Case 09 $MDAY = "9" EndSwitch $Date = @MON & "/" & $MDAY & "/" & @YEAR ConsoleWrite($Date & @CRLF) For $i = 1 to UBound($aTableData) - 1 $result = StringInStr($aTableData[$i][1], $Date) If $result > 0 Then ConsoleWrite($aTableData[$i][1] & $i & @CRLF) Next And then here is the output: 12/3/2013 Please Wait... Round: 1349 Visit: Tuesday - 12/3/2013 Start Time: Shift: 11:45AM- 8:15PM8 Edited December 3, 2013 by Kidney Link to comment Share on other sites More sharing options...
guinness Posted December 3, 2013 Share Posted December 3, 2013 Why not just use StringReplace() or StringTrimLeft()? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
kylomas Posted December 3, 2013 Share Posted December 3, 2013 (edited) That answers the day part, now you can do the month part, or, see post #7 Edited December 3, 2013 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
jdelaney Posted December 3, 2013 Share Posted December 3, 2013 (edited) no need for the switch: $sDayWithNoLead0 = StringRegExpReplace(@MDAY,"(0)(\d+)","\2") ConsoleWrite($sDayWithNoLead0 & @CRLF) $sDayWithNoLead0 = StringRegExpReplace("01","(0)(\d+)","\2") ConsoleWrite($sDayWithNoLead0 & @CRLF) $sDayWithNoLead0 = StringRegExpReplace("09","(0)(\d+)","\2") ConsoleWrite($sDayWithNoLead0 & @CRLF) $sDayWithNoLead0 = StringRegExpReplace("10","(0)(\d+)","\2") ConsoleWrite($sDayWithNoLead0 & @CRLF) example outputs for the second (just to demonstrate) 1 9 10 haha, even easier: ConsoleWrite(Number(@MDAY) & @CRLF) Edited December 3, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Kidney Posted December 3, 2013 Author Share Posted December 3, 2013 Why not just use StringReplace() or StringTrimLeft()? because the array I am using has 5 columns but only 2 that I actually care about. the one with the date and then the one with the link to the call report for that day. However, the call report id has not barring on the date and the link to click has the same text as all the other call reports. so im trying to find the row with the correct day and then just click the link in the appropriate column and row. Link to comment Share on other sites More sharing options...
guinness Posted December 3, 2013 Share Posted December 3, 2013 No kidney, I meant what is wrong with this... Local $MDAY = StringReplace(@MDAY, '0', '') ConsoleWrite($MDAY & @CRLF) UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Kidney Posted December 3, 2013 Author Share Posted December 3, 2013 No kidney, I meant what is wrong with this... Local $MDAY = StringReplace(@MDAY, '0', '') ConsoleWrite($MDAY & @CRLF) ...... That will work much better than my solution..... Link to comment Share on other sites More sharing options...
jdelaney Posted December 3, 2013 Share Posted December 3, 2013 (edited) Local $MDAY = StringReplace(@MDAY, '0', '') ConsoleWrite($MDAY & @CRLF) Nope, the above will replace 10 with 1. Use my example: ConsoleWrite(Number(@MDAY) & @CRLF) Edited December 3, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
guinness Posted December 3, 2013 Share Posted December 3, 2013 Nope, that will replace 10 with 1. Use my example: ConsoleWrite(Number(@MDAY) & @CRLF) I am only going by what kidney provided as an example. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
jdelaney Posted December 3, 2013 Share Posted December 3, 2013 gotcha, I was suggesting a global fix for any day...to remove leading 0's For $i = 1 To 31 If StringLen($i) = 1 Then $number = "0" & $i Else $number = $i EndIf ConsoleWrite("Before=[" & $number & "]; After=[" & Number($number) & "]" & @CRLF) Next IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
kylomas Posted December 3, 2013 Share Posted December 3, 2013 @jdelaney - Nice, K.I.S.S. $Date = StringRegExpReplace(@MON,"(0)(\d+)","\2") & "/" & StringRegExpReplace(@MDAY,"(0)(\d+)","\2") & "/" & @YEAR ConsoleWrite($date & @LF) Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
jdelaney Posted December 3, 2013 Share Posted December 3, 2013 (edited) I post-pended an even easier fix, on #11...which would then be: $Date = Number(@MON) & "/" & Number(@MDAY) & "/" & @YEAR ConsoleWrite($date & @LF) (edit: as you can tell, I'm averse to quotes) (edit2: Int() would result in the same...not sure which would be the best...probably Int) Edited December 3, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
kylomas Posted December 3, 2013 Share Posted December 3, 2013 I think I like the SRE solution better as it does not rely on converison rules which could change...splitting hairs, perhaps... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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