swoop

Au3 Stripper Issues

9 posts in this topic

#1 ·  Posted (edited)

$iStart = _ArraySearch($aArray, $vValue, $iStart, $iEnd, $iCase, $iCompare, 1, $iSubItem, $bRow)
If @error Then Return SetError(@error, 0, -1)
Local $iIndex = 0, $avResult[UBound($aArray,($bRow ? $UBOUND_COLUMNS : $UBOUND_ROWS))]
Do
$avResult[$iIndex] = $iStart
$iIndex += 1
$iStart = _ArraySearch($aArray, $vValue, $iStart + 1, $iEnd, $iCase, $iCompare, 1, $iSubItem, $bRow)
Until @error

I get the error when I compile my code,  warning: $UBOUND_ROWS: possibly used before declaration.
Local $iIndex = 0, $avResult[UBound($aArray,($bRow ? $UBOUND_COLUMNS : $UBOUND_ROWS)

error: $UBOUND_ROWS: undeclared global variable.
Local $iIndex = 0, $avResult[UBound($aArray,($bRow ? $UBOUND_COLUMNS : $UBOUND_ROWS)

The above referenced code snippet is where the Stripped Au3 code fails.

But without using the directive: #AutoIt3Wrapper_Run_Au3Stripper=y  the code runs fine and is able to compile.

What's the best way to debug or diagnose this issue?

 

Edited by swoop
Hit Return to get new line space, but it submitted topic

Share this post


Link to post
Share on other sites



I think I found where in the code this happens:

_run_once ("Login.exe")

Func _run_once ($process_name)

    Local $processArray 

    $process_list = ProcessList()
    
    $processArray = _ArrayFindAll($process_list, $process_name)
    $process_sum = UBound($processArray)

    For $i = $process_sum to 2 Step -1
        ProcessClose($process_name)
    Next
EndFunc

But I am unsure why using the Stripper should cause an error, but it runs fine without the Stripper.

So, when I compile the following with the Stripper turned on, I get the error. However, remove the Stripper directives and the code compiles fine.

#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/tl /debug /sf /sv /rsln
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Array.au3>

_run_once ("Login.exe")

Func _run_once ($process_name)

    Local $processArray

    $process_list = ProcessList()

    $processArray = _ArrayFindAll($process_list, $process_name)
    $process_sum = UBound($processArray)

    For $i = $process_sum to 2 Step -1
        ProcessClose($process_name)
    Next
EndFunc

 

 

 

 

Share this post


Link to post
Share on other sites

The Ubound error is created when the AutoIt script is compiled while stripped. In the stripped code, this is where it fails:

Local $iIndex = 0, $avResult[UBound($aArray,($bRow ? $UBOUND_COLUMNS : $UBOUND_ROWS))]


It is generated by the stripper, not the original code in the script. By default the UBound uses $UBOUND_ROWS. I tried to specifically declare it to use $UBOUND_ROWS, but I get the same compile error after compiling it with the stripper:

$process_sum = UBound($processArray,1)

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I can't test at the moment, but could you try the current Beta version of au3stripper to see if the issue persists?

Edit: just tested with AU3Check v3.3.15.1 and don;t get any errors on the stripped script with au3check or when ran, so give it a try and in case you still have issues, provide an example I can run giving me an error.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hello Jos,

I downloaded the latest Beta from https://www.autoitscript.com/site/autoit/downloads/ and still get the error. But the version is 3.3.15.0 for AutoIt Beta. Where do I get 3.3.15.1?

When I install the AutoIt 3.3.15.0 Beta, and go to the AutoIt program folder, the AU3Check properties says: 3.3.14.2 Date Modified on 9/18/2015.

 

Share this post


Link to post
Share on other sites

There is real relation to the AutoIt3 version. As stated, post something I can test with as I tried the script you posted but that doesn't trigger ant error for me on the stripped sourcecode.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

That's very strange. The code posted fails for me on compile using the Beta. With the same error.

I'll try to find another computer to install AutoIt Beta on to try. Not sure if that would make a difference.

Share this post


Link to post
Share on other sites

Show us the line where  $UBOUND_ROWS  is declared

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