Jump to content

Problems with included array.au3


bourny
 Share

Recommended Posts

I am starting to get errors from Scite au3checker about my variables since updating to the latest V3.2.12.1

I did not get these errors on the last version I installed which was 3.2.2.0

I also have had to remove the runErrorsFatal as this has been removed in the latest release.

The issues I am getting appear to be with the use of my array calls .

Global $ArrayOfAppsToInstall = StringSplit($ListofApps, @lf)

_ArrayDelete($ArrayOfAppsToInstall, 0)

$ArrayPosition = _ArraySearch($ArrayOfAppsToInstall, $Friendly)

_ArrayDelete($ArrayOfAppsToInstall,$ArrayPosition)

_ArrayInsert($ArrayOfAppsToInstall,$ArrayPosition, $Friendly & $TaskTime)

$ProgressBalloon = _ArrayToString($ArrayOfAppsToInstall, @lf)

These lines are inside the script at various places but work on the 3.2.2.0 but get the following errors with the latest version when checked

C:\Program Files\AutoIt3\Include\Array.au3(798,130) : ERROR: _ArraySearch() previously called with expression on Const ByRef param(s).

Func _ArraySearch(Const ByRef $avArray, $vValue, $iStart = 0, $iEnd = 0, $iCase = 0, $iPartial = 0, $iForward = 1, $iSubItem = 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

\\Rssncl3dm2\images\Build Scripts\Scripts\Builds\AppStub6.AU3(4462,66) : REF: first call to _ArraySearch().

$ArrayPosition = _ArraySearch($ArrayOfAppsToInstall, $Friendly)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\Array.au3(1118,81) : ERROR: _ArrayToString() previously called with expression on Const ByRef param(s).

Func _ArrayToString(Const ByRef $avArray, $sDelim = "|", $iStart = 0, $iEnd = 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

\\Rssncl3dm2\images\Build Scripts\Scripts\Builds\AppStub6.AU3(4432,62) : REF: first call to _ArrayToString().

$ProgressBalloon = _ArrayToString($ArrayOfAppsToInstall, @lf)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Can anyone help me figure out what I need to do with my arrays to make them work with the new version of autoIT.

will there also be any issues with the RunErrorsFatal being removed when the Run Statement fails.

Thanks

Link to comment
Share on other sites

I am starting to get errors from Scite au3checker about my variables since updating to the latest V3.2.12.1

I did not get these errors on the last version I installed which was 3.2.2.0

I also have had to remove the runErrorsFatal as this has been removed in the latest release.

The issues I am getting appear to be with the use of my array calls .

Global $ArrayOfAppsToInstall = StringSplit($ListofApps, @lf)

_ArrayDelete($ArrayOfAppsToInstall, 0)

$ArrayPosition = _ArraySearch($ArrayOfAppsToInstall, $Friendly)

_ArrayDelete($ArrayOfAppsToInstall,$ArrayPosition)

_ArrayInsert($ArrayOfAppsToInstall,$ArrayPosition, $Friendly & $TaskTime)

$ProgressBalloon = _ArrayToString($ArrayOfAppsToInstall, @lf)

These lines are inside the script at various places but work on the 3.2.2.0 but get the following errors with the latest version when checked

C:\Program Files\AutoIt3\Include\Array.au3(798,130) : ERROR: _ArraySearch() previously called with expression on Const ByRef param(s).

Func _ArraySearch(Const ByRef $avArray, $vValue, $iStart = 0, $iEnd = 0, $iCase = 0, $iPartial = 0, $iForward = 1, $iSubItem = 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

\\Rssncl3dm2\images\Build Scripts\Scripts\Builds\AppStub6.AU3(4462,66) : REF: first call to _ArraySearch().

$ArrayPosition = _ArraySearch($ArrayOfAppsToInstall, $Friendly)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\Array.au3(1118,81) : ERROR: _ArrayToString() previously called with expression on Const ByRef param(s).

Func _ArrayToString(Const ByRef $avArray, $sDelim = "|", $iStart = 0, $iEnd = 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

\\Rssncl3dm2\images\Build Scripts\Scripts\Builds\AppStub6.AU3(4432,62) : REF: first call to _ArrayToString().

$ProgressBalloon = _ArrayToString($ArrayOfAppsToInstall, @lf)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Can anyone help me figure out what I need to do with my arrays to make them work with the new version of autoIT.

will there also be any issues with the RunErrorsFatal being removed when the Run Statement fails.

Thanks

Did you do the uninstall of the previous version on installing 3.2.12.1? Because this runs fine:
#include <Array.au3>

Global $ListofApps = "one" & @LF & "two" & @LF & "three"  & @LF & "four"
Global $Friendly = "three"
Global $TaskTime = " " & @HOUR & ":" & @MIN
Global $ArrayOfAppsToInstall = StringSplit($ListofApps, @lf)

_ArrayDelete($ArrayOfAppsToInstall, 0)
$ArrayPosition = _ArraySearch($ArrayOfAppsToInstall, $Friendly)
_ArrayDelete($ArrayOfAppsToInstall,$ArrayPosition)
_ArrayInsert($ArrayOfAppsToInstall,$ArrayPosition, $Friendly & $TaskTime)
$ProgressBalloon = _ArrayToString($ArrayOfAppsToInstall, @lf)

ConsoleWrite("$ProgressBalloon = " & $ProgressBalloon & @LF)

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

It appears to also work fine on my test script using the exact same functions and variables. I beleive I have an issue on my larger main script that the latest version picks up but the older version does not.

What I am looking for is a clue to what the error means so I know where to look for the issue ... Its probably the way I am setting my variables used in the script that it is getting upset about. I need some clue to what to look for ...

Link to comment
Share on other sites

I think this means that you call _ArraySearch as

_ArraySearch(_Function(...),...)

but in new Version you have to call this way:

$ReturnVal = _Function(...)

_ArraySearch($ReturnVal,...)

and the same error happens in _ArrayToString

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Thanks for your replies but I have found the answer

#include <Array.au3> was defined below the include for my stub file that was using the array functions.

I have moved it from

#include "AppStub6.AU3" (has the array functions in here)

#include <Array.au3>

to

#include <Array.au3>

#include "AppStub6.AU3"

How wiered is that that previous versions let you define the include files at any point where as the new version it has to be in the correct place to work

I this an upgrade or downgrade of functionality

Link to comment
Share on other sites

Thanks for your replies but I have found the answer

#include <Array.au3> was defined below the include for my stub file that was using the array functions.

I have moved it from

#include "AppStub6.AU3" (has the array functions in here)

#include <Array.au3>

to

#include <Array.au3>

#include "AppStub6.AU3"

How wiered is that that previous versions let you define the include files at any point where as the new version it has to be in the correct place to work

I this an upgrade or downgrade of functionality

If AppStub6.AU3 refers to constants that are in array.au3 then AutoIt would never have worked if you had the array.au3 after the AppStub6.AU3.

EDIT: changed "functions" to "constants" after Richard Robinson's post pointed out I was wrong.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Functions don't have to be defined in any order. You could list all your includes at the end of the file even as long as they don't declare any variables.

Correct, I should have said Constants not Functions. I'll fix my post.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...