Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Compile Bug;Error: Array variable has incorrect number of subscripts or subscri...


  • Please log in to reply
32 replies to this topic

#21 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 28 December 2007 - 08:05 PM

Still not work.. pls tell me how to compile with Aut2exe(i mean on options)?

set:
compile for system : Unicode
compression: Normal
UPX Compress .exe stub - default ON

and not work..

Edited by n3nE, 28 December 2007 - 08:17 PM.

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)







#22 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 28 December 2007 - 08:34 PM

Here is screenshot:
Posted Image

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)

#23 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 28 December 2007 - 08:40 PM

What version of AutoIt are you compiling with?

Just want to make sure we are looking at the same version.

Edited by GaryFrost, 28 December 2007 - 08:41 PM.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#24 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 28 December 2007 - 08:51 PM

I compiled it with 3.2.10.0 and copied the exe to a WinXP Pro SP2 machine without AutoIt installed and also to a Win2K Pro SP4 machine without AutoIt installed and both work fine.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#25 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 29 December 2007 - 12:49 AM

I have v3.2.10.0, beta is 3.2.9.14 and i compile script with Aut2Exe v3, and i set next options:

compile for system : Unicode
compression: Normal or Highest
UPX Compress .exe stub - default ON

and don't work, how to compile on other way ?

(i have installed only autoit 3.2.10.0 and beta 3.2.9.14... i don't have Auto3Lib.exe,.)

Edited by n3nE, 29 December 2007 - 12:50 AM.

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)

#26 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 29 December 2007 - 12:56 AM

I have v3.2.10.0, beta is 3.2.9.14 and i compile script with Aut2Exe v3, and i set next options:

compile for system : Unicode
compression: Normal or Highest
UPX Compress .exe stub - default ON

and don't work, how to compile on other way ?

(i have installed only autoit 3.2.10.0 and beta 3.2.9.14... i don't have Auto3Lib.exe,.)


Same here, and it works fine.

SciTE for AutoItDirections for Submitting Standard UDFs

Don't argue with an idiot; people watching may not be able to tell the difference.


#27 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 29 December 2007 - 01:01 AM

Do you want to send me that exe and to I send to someone who don't have Autoit to see ... if works then i don't know to compile good..but if don't works then is windows crashed ;D

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)

#28 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 29 December 2007 - 01:19 AM

Your code is rather flawed. It requires a file > 1MB to even work. Your $Button2 handler relies on data that's set when $Button3 is called. This is dangerous. Even though you disable the button, it's still stupid to rely on this tenuous sequence of events like that. The only way this script can produce an invalid array index error is if $Button2 is called before $Button3. As far as I can tell, this is NO BUG. So, you either need to go back to the drawing board and come up with an example that can reproduce the problem or start giving a hell of a lot more information. It's like pulling teeth to get any information from you. Furthermore, this isn't even "the simplest possible script that can demonstrate the problem". There's a lot of code in there that can't possibly be the cause of the error since array access is only performed in 2 places.

By the way, your "someone" isn't downloading an AutoIt script through your program, then launching it and the launched script has an error, is it? That seems about as likely as this script in producing an error.

#29 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 29 December 2007 - 01:43 AM

Sorry but how to make on other way and why like script works on my computer but on other computers not work ?

what diferents does it take?

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)

#30 jpm

jpm

    a Real GUI/debug lover

  • Developers
  • 9,749 posts

Posted 29 December 2007 - 10:29 AM

Sorry but how to make on other way and why like script works on my computer but on other computers not work ?

what diferents does it take?

Certainly Valik is right you can check with the attach file running on the nasty computer the .exe version that's is working fine.
Te .au3 is the source I use from your post to produce .exe with the standard v3.2.10.0

#31 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 01 January 2008 - 09:32 PM

:) That works but compile "n3 Adresar" and test.. probably error in script but i don't understand why works like script and like aplikation on my comp.....never mind.. i giving up with autoit :P


...and happy new year everybody :blink:

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)

#32 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 01 January 2008 - 10:12 PM

i giving up with autoit

You shouldn't, just because you get error, it's not mean that you can not fix it...

I sure if you will understand how Arrays really works, you will see that this error can be fixed, you need to do some error checking :P

Like this:

AutoIt         
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=n3 Downloader by n3nE #AutoIt3Wrapper_Res_Description=n3 Downloader #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstants.au3> #include <String.au3> $download = False Global $a, $a2, $name, $Remain $gui = "n3 Downloader" $Form1 = GUICreate($gui, 546, 258, -1, -1) $Progress1 = GUICtrlCreateProgress(16, 200, 513, 17) $Button1 = GUICtrlCreateButton("Cancel", 432, 224, 97, 25, 0) $Button2 = GUICtrlCreateButton("Download", 328, 224, 97, 25, 0) $Button4 = GUICtrlCreateButton("Open file", 328, 224, 97, 25, 0) GUICtrlSetState($Button4, $GUI_HIDE) $Button3 = GUICtrlCreateButton("Check link", 224, 224, 97, 25, 0) $edit = GUICtrlCreateEdit("",16,227,201,19,$ES_AUTOHSCROLL) $Group1 = GUICtrlCreateGroup("Status", 16, 144, 513, 41) $Label3 = GUICtrlCreateLabel("Please insert link...", 32, 160, 492, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("File", 16, 72, 513, 65) $Label1 = GUICtrlCreateLabel("Link:", 32, 96, 491, 17,$SS_LEFTNOWORDWRAP) $Label2 = GUICtrlCreateLabel("Size:", 32, 112, 491, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label4 = GUICtrlCreateLabel("Welcome to n3 Downloader!", 16, 16, 516, 44, BitOR($SS_CENTER,$SS_CENTERIMAGE,$SS_RIGHTJUST,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE,$GUI_WS_EX_PARENTDRAG)) GUICtrlSetFont(-1, 20, 400, 0, "Arial") GUICtrlSetState($Button2, $GUI_DISABLE) GUISetState(@SW_SHOW) AdlibEnable("check", 100) While 1     If $download Then         $Percent = Int((@InetGetBytesRead * 100) / $a)         $Remain = StringSplit(@InetGetBytesRead, ".")         GUICtrlSetData($Progress1, $Percent)     EndIf     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Button1             Exit         Case $Button3             GUICtrlSetState($Button2, $GUI_SHOW)             GUICtrlSetState($Button4, $GUI_HIDE)             $link = GUICtrlRead($edit)             $a = InetGetSize($link)             $a2 = StringSplit($a/1024, ".")             If UBound($a2) > 1 And $a2[1] <> 0 Then                 GUICtrlSetData($Label2,"Size: " & $a2[1] & " KB")                 GUICtrlSetData($Label1,"Link: " & $link)                 GUICtrlSetState($Button2, $GUI_ENABLE)                 GUICtrlSetData($Progress1,"0")                 GUICtrlSetData($Label3,"Click on 'Download' button do start with downloading file...")                 $name = StringMid($link, StringInStr($link, "/", 0, -1)+1)             Else                 GUICtrlSetData($Progress1,"0")             EndIf         Case $Button2             GUICtrlSetState($edit, $GUI_DISABLE)             GUICtrlSetState($Button2, $GUI_DISABLE)             GUICtrlSetState($Button3, $GUI_DISABLE)             $download = True             If UBound($a2) > 1 And $a2[1] <> 0 Then             InetGet($link,@DesktopDir & "\" & $name, 1, 1)         EndIf     Case $Button4         If FileExists(@DesktopDir & "\" & $name) = 1 Then         _Start('"' & $name & '" /S')         Guictrlsetdata($label3,$name & " is downloaded!")         ElseIf FileExists(@DesktopDir & "\" & $name) = 0 Then         Guictrlsetdata($label3,"File not exist")         EndIf     EndSwitch WEnd Func check()     If $download = True Then         If $Percent < 100 Then             $sRemain = ""             $s_a2 = ""                         If UBound($Remain) > 1 Then $sRemain = $Remain[1]             If UBound($a2) > 1 Then $s_a2 = $a2[1]                         WinSetTitle($Form1,"",$gui & " - " & $Percent & "% Downloaded")             GUICtrlSetData($Label3,"Downloading " & $name & ",downloaded: " & $Percent & "%," & "(" & $sRemain/1024 & "/"& $s_a2 & "Kb" & ")")         Else             WinSetTitle($Form1,"",$gui & " - " & $name & " is downloaded!")             GUICtrlSetData($Label3, $name & " is downloaded!")             GUICtrlSetState($edit, $GUI_ENABLE)             ;GUICtrlSetState($Button2, $GUI_ENABLE)             GUICtrlSetState($Button2, $GUI_HIDE)             GUICtrlSetState($Button4, $GUI_SHOW)             GUICtrlSetState($Button3, $GUI_ENABLE)             ;GUICtrlSetState($Button3, $GUI_ENABLE)             $download = False         EndIf     EndIf EndFunc   ;==>check Func _Start($s_StartPath)     If @OSTYPE = 'WIN32_NT' Then         $s_StartStr = @ComSpec & ' /c start "" '     Else         $s_StartStr = @ComSpec & ' /c start '     EndIf     Run($s_StartStr & $s_StartPath, '', @SW_HIDE) EndFunc   ;==>_Start


I checked here with Uboud() every time array variable is used, so if it really have that much elements ( [1] ), we can use it safely :wub:

That way you will never get error that will crash your script, it's just matter of proper scripting :blink:

P.S
Sorry for the offtopic :)

Edited by MsCreatoR, 01 January 2008 - 10:13 PM.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#33 Madza91

Madza91

    Madža91

  • Active Members
  • PipPipPipPipPipPip
  • 531 posts

Posted 01 January 2008 - 10:30 PM

hehe, i will be stude that code,, thank you:)

This is a help forum not a "write this for me" forum.

(Sorry for bad English) :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users