Jump to content
Sign in to follow this  
MeisterMan

error for no reason on a same machine but differnt user

Recommended Posts

MeisterMan

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

Share this post


Link to post
Share on other sites
UEZ

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
MeisterMan

nevermind i fixed it seemed like i didnt even need to use the variables in multi dimensional way... i just used  $splitdate normally :P you can delete this post , sorry :D^_^ 

Share this post


Link to post
Share on other sites
MeisterMan

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 by MeisterMan

Share this post


Link to post
Share on other sites
Melba23

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. :huh:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MeisterMan

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 by MeisterMan

Share this post


Link to post
Share on other sites
Melba23

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


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MeisterMan

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

Share this post


Link to post
Share on other sites
AutID

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...

Share this post


Link to post
Share on other sites
Melba23

MeisterMan,

Where did that code come from? :huh:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MeisterMan

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? :D i dont know how to get rid of it...yet i am still trying to fix it 

MeisterMan,

Where did that code come from? :huh:

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 by MeisterMan

Share this post


Link to post
Share on other sites
Melba23

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. :wacko:

I suggest you post the whole script so they we can see exactly what is going on. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MeisterMan

my autoit is 3.2.0.0 :D maybe i should update :D

Share this post


Link to post
Share on other sites
Melba23

MeisterMan,

 

maybe i should update

That version is only 7 years behind the current Beta - I see no reason to be precipitate! :whistle:

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. :wacko:

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


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MeisterMan

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 ! ^_^

#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 by MeisterMan

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×