MeisterMan Posted November 1, 2013 Posted November 1, 2013 Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $comapredDate = _DateDiff('D', $splitDate[3]&"/"&$splitDate[2]&"/"&$splitDate[1] , $splitDateServ[3]&"/"&$splitDateServ[2]&"/"&$splitDateServ[1]) $comapredDate = _DateDiff('D', $splitDate[3]&"/"&$splitDate[2]&"/"&$splitDate[1] , ^ ERROR i get thus error on my other user account on same computer... win7 64bit
UEZ Posted November 1, 2013 Posted November 1, 2013 Show the full code. Seems that $splitDateServ is not as expected. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
MeisterMan Posted November 1, 2013 Author Posted November 1, 2013 nevermind i fixed it seemed like i didnt even need to use the variables in multi dimensional way... i just used $splitdate normally you can delete this post , sorry
MeisterMan Posted November 2, 2013 Author Posted November 2, 2013 (edited) my friend is getting the errors now on his computer same code... the funny thing is its compiled exe and it runs fine on my computer. but his computer says error... $splitDateServ = StringSplit($UserDateEnd, "/") ; day / month / year;read file online with date $splitDate = StringSplit($ServerGetDate, "/") ;day / month / year ; read date from internet ;~ $comapredDate = _DateDiff('D', $ServerGetDate , $UserCreditBalance) ;doesnt work like this... $comapredDate = _DateDiff('D', $splitDate[3]&"/"&$splitDate[2]&"/"&$splitDate[1] , $splitDateServ[3]&"/"&$splitDateServ[2]&"/"&$splitDateServ[1]) Edited November 2, 2013 by MeisterMan
Moderators Melba23 Posted November 2, 2013 Moderators Posted November 2, 2013 MeisterMan,Add some errorchecking to make sure you have an array after the StringSplit operation - that will solve the immediate problem. From where do you get the various date strings you are subsequently splitting? It is obvious that sometimes these values are not in the format you expect which leads to the error when you try to manipulate them. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MeisterMan Posted November 2, 2013 Author Posted November 2, 2013 (edited) i just checked with msgbox() the strings ... and they both are returned in same format like Day/Month/Year ... but if i do this OK just ran a few msgbox() with @error outputs... and the error is at _DateDiff() with error #2 which is --> 2 - Invalid $sStartDate but i dont get how can it be wrong? EEDIT :: i ran obfuscator ... to find whats the line with error... Func A07B2B04015($A205A80252B, $A414E903021, $A38CF225F0E) If Not Isdeclared("SSA07B2B04015") Then Global $A1FD3930C41=A4C00002426($Os[0x24EB]),$A17D3A36061=A4C00002426($Os[0x24EC]),$A53D3B36356=A4C00002426($Os[0x24ED]) Global $SSA07B2B04015=0x01 EndIF Local $A4F99023103 $A4F99023103 = DllStructCreate($A4B28801A42) DllStructSetData($A4F99023103, $A1FD3930C41, $A4484504A45) DllStructSetData($A4F99023103, $A17D3A36061, $A414E903021) DllStructSetData($A4F99023103, $A53D3B36356, $A38CF225F0E) ; <--- this line.. ?????? gives error... A39B2903101($A205A80252B, $A4F99023103) EndFunc $splitDateServ = StringSplit($UserDateEnd, "/") ; day / month / year;read file online with date $splitDate = StringSplit($ServerGetDate, "/") ;day / month / year ; read date from internet $comapredDate = _DateDiff('D', $ServerGetDate , $UserCreditBalance) ;<--- this i tryed and wont work... altho both results are in same format as day-month-year ... Edited November 2, 2013 by MeisterMan
Moderators Melba23 Posted November 2, 2013 Moderators Posted November 2, 2013 MeisterMan,Your comments say: "altho both results are in same format as day-month-year"whereas the Help file for _DateDiff says that the dates should be: "in the format "YYYY/MM/DD[ HH:MM:SS]""So it is hardly surprising that the error occurs. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MeisterMan Posted November 2, 2013 Author Posted November 2, 2013 yes i fixed that but still the error is in this now.. Func A07B2B04015($A205A80252B, $A414E903021, $A38CF225F0E) If Not Isdeclared("SSA07B2B04015") Then Global $A1FD3930C41=A4C00002426($Os[0x24EB]),$A17D3A36061=A4C00002426($Os[0x24EC]),$A53D3B36356=A4C00002426($Os[0x24ED]) Global $SSA07B2B04015=0x01 EndIF Local $A4F99023103 $A4F99023103 = DllStructCreate($A4B28801A42) DllStructSetData($A4F99023103, $A1FD3930C41, $A4484504A45) DllStructSetData($A4F99023103, $A17D3A36061, $A414E903021) DllStructSetData($A4F99023103, $A53D3B36356, $A38CF225F0E) ; <--- this line.. ?????? gives error... A39B2903101($A205A80252B, $A4F99023103) EndFunc
AutID Posted November 2, 2013 Posted November 2, 2013 yes i fixed that but still the error is in this now..Func A07B2B04015($A205A80252B, $A414E903021, $A38CF225F0E) If Not Isdeclared("SSA07B2B04015") Then Global $A1FD3930C41=A4C00002426($Os[0x24EB]),$A17D3A36061=A4C00002426($Os[0x24EC]),$A53D3B36356=A4C00002426($Os[0x24ED]) Global $SSA07B2B04015=0x01 EndIF Local $A4F99023103 $A4F99023103 = DllStructCreate($A4B28801A42) DllStructSetData($A4F99023103, $A1FD3930C41, $A4484504A45) DllStructSetData($A4F99023103, $A17D3A36061, $A414E903021) DllStructSetData($A4F99023103, $A53D3B36356, $A38CF225F0E) ; <--- this line.. ?????? gives error... A39B2903101($A205A80252B, $A4F99023103) EndFunc I know this function. I had made a very similar one when i wanted to protect a project from getting decompiled and if so from being understandable if it is dicompiled! However if this not the case then i dont think someone will understand much when seeing this code... https://iblockify.wordpress.com/
Moderators Melba23 Posted November 2, 2013 Moderators Posted November 2, 2013 MeisterMan,Where did that code come from? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MeisterMan Posted November 2, 2013 Author Posted November 2, 2013 (edited) I know this function. I had made a very similar one when i wanted to protect a project from getting decompiled and if so from being understandable if it is dicompiled! However if this not the case then i dont think someone will understand much when seeing this code... so what is this exactly? i dont know how to get rid of it...yet i am still trying to fix it MeisterMan, Where did that code come from? M23 i ran obfuscator to get full code.... and the error line i get from exe was 13xxxx which was that line. EDIT : these are all includes i have in my script #AutoIt3Wrapper_Icon=source/icon.ico #AutoIt3Wrapper_UseUpx=n #include "source/_ErrorHandler.au3" #include <ButtonConstants.au3> #include <SliderConstants.au3> #include "source/NTS.au3" #include <ComboConstants.au3> #include <Date.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #Include <GuiComboBox.au3> #include <ProgressConstants.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <UpdownConstants.au3> #include <GuiListView.au3> #include <Misc.au3> #include <resources.au3> #include <Inet.au3> #include <TabConstants.au3> Edited November 2, 2013 by MeisterMan
Moderators Melba23 Posted November 2, 2013 Moderators Posted November 2, 2013 MeisterMan,And what does that snippet of code look like when it is not obfuscated? What is it supposed to do? Because at the moment it is as much use as chocolate fireguard. I suggest you post the whole script so they we can see exactly what is going on. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MeisterMan Posted November 2, 2013 Author Posted November 2, 2013 my autoit is 3.2.0.0 maybe i should update
Moderators Melba23 Posted November 2, 2013 Moderators Posted November 2, 2013 MeisterMan, maybe i should updateThat version is only 7 years behind the current Beta - I see no reason to be precipitate! But the GUIConstantsEx.au3 include file you say that you are using was introduced in 3.3.12.0 as I remember so you might well have problems running the code with a much earlier version. I still suggest posting the whole script - we could still make an educated guess as to what is going wrong if we could see the whole thing and not just a few snippets which may or may not have anything to do with the problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MeisterMan Posted November 2, 2013 Author Posted November 2, 2013 (edited) btw its nothing much its just that date diff with timerinit and timerdiff... but i just did a full code debug and it IS the dateDiff() thing that gives problems...on my computer i can run the scrpt fine without any errors! but my friends same windows 7 64bit machine gives error with datediff... EDIT: found the problem ! expandcollapse popup#include <date.au3> #include <inet.au3> Func _SetTimeFromNTP($sNTPServer) Local $sData = "" TCPStartup() If TCPNameToIP($sNTPServer) = "" Then Return SetError(1) UDPStartup() $aSocket = UDPOpen(TCPNameToIP($sNTPServer), 123) $sStatus = UDPSend($aSocket, _MakePacket()) While $sData = "" $sData = UDPRecv($aSocket, 100) Sleep(250) WEnd UDPCloseSocket($aSocket) TCPShutdown() $sValue = _UnsignedHexToDecimal(StringMid($sData, 83, 8)) $aTimeZone = _Date_Time_GetTimeZoneInformation() $sUTC = _DateAdd("s", $sValue, "1900/01/01 00:00:00") If $aTimeZone[0] <> 2 Then $iTimeZoneOffset = ($aTimeZone[1]) * -1 Else $iTimeZoneOffset = ($aTimeZone[1] + $aTimeZone[7]) * -1 EndIf Local $iMonth = StringMid($sUTC, 6, 2), $iDay = StringMid($sUTC, 9, 2), $iYear = StringMid($sUTC, 1, 4), _ $iHour = StringMid($sUTC, 12, 2), $iMinute = StringMid($sUTC, 15, 2), $iSecond = StringMid($sUTC, 18, 2) ;~ ConsoleWrite("Time = " & $iMonth & " " & $iDay & " " & $iYear & " " & $iHour & " " & $iMinute & " " & $iSecond & @CR) Return $iDay&"/"&$iMonth&"/"&$iYear ;~ $sCurrentTime = _Date_Time_EncodeSystemTime($iMonth, $iDay, $iYear, $iHour, $iMinute, $iSecond) ; <-- this line gave the error so i commented it out ! ;_Date_Time_SetSystemTime(DllStructGetPtr($sCurrentTime)) EndFunc Func _MakePacket() Local $x, $sPacket = "1b0e01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" While $sPacket $x &= Chr(Dec(StringLeft($sPacket, 2))) $sPacket = StringTrimLeft($sPacket, 2) WEnd Return $x EndFunc Func _UnsignedHexToDecimal($sInput) $x = StringRight($sInput, 1) $sInput = StringTrimRight($sInput, 1) Return Dec($sInput) * 16 + Dec($x) EndFunc Edited November 2, 2013 by MeisterMan
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