Jump to content

_Array.au3 feature request


Recommended Posts

hi,

enhancement for Arrays request:

_ArrayTrimdown - will remove all Array element from the bottom up x times.

_ArrayTrimup - will remove all Array element from the bottom down x times.

_ArrayTrimBetween - will remove all Array element from x to y (iElement position).

can it be done?

Link to post
Share on other sites

hi,

enhancement for Arrays request:

_ArrayTrimdown - will remove all Array element from the bottom up x times.

_ArrayTrimup - will remove all Array element from the bottom down x times.

_ArrayTrimBetween - will remove all Array element from x to y (iElement position).

can it be done?

Hi,

you can do it with udfs. Will that be enough for you?

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites

I am around here for 3 month and keep hearing the work UDF, can someone explain what this does and where to find it?

UDF = user defined function. E.g. a function written by yourself

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites

Here is something to start with

#include<Array.au3>
#cs
    _ArrayTrimdown - will remove all Array element from the bottom up x times.
    _ArrayTrimup - will remove all Array element from the bottom down x times.
    _ArrayTrimBetween - will remove all Array element from x to y (iElement position).
#ce

Global $array[10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], $re

$re = _ArrayTrimdown($array, 3)
_ArrayDisplay($re, '_ArrayTrimdown')
$re = _ArrayTrimup($array, 5)
_ArrayDisplay($re, '_ArrayTrimup')
$re = _ArrayTrimBetween($array, 2, 5)
_ArrayDisplay($re, '_ArrayTrimBetween')

Func _ArrayTrimdown(ByRef $array, $count)
    Local $new_A[UBound($array) - $count]
    For $i = 0 To UBound($new_A) - 1
        $new_A[$i] = $array[$i]
    Next
    Return $new_A
EndFunc   ;==>_ArrayTrimdown

Func _ArrayTrimup(ByRef $array, $count)
    Local $new_A[UBound($array) - $count]
    For $i = $count To UBound($array) - 1
        $new_A[$i - $count] = $array[$i]
    Next
    Return $new_A
EndFunc   ;==>_ArrayTrimup

Func _ArrayTrimBetween(ByRef $array, $start, $end)
    Local $new_A[UBound($array)]
    Local $y = 0
    For $i = 0 To UBound($new_A) - 1
        If Not ($i >= $start And $i <= $end) Then
            $new_A[$y] = $array[$i]
            $y += 1
        EndIf
    Next
    ReDim $new_A[UBound($new_A) - 1 + $start - $end]
    Return $new_A
EndFunc   ;==>_ArrayTrimBetween

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites

yes, I did that exactly, but I was thinking more on a commnad that does it in AutoIT base code.

Then the devs should answer but I suppose IF .. IF they really answer then it is to 99,9 % NO!!!

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites
  • Developers

.......but I suppose IF .. IF they really answer then it is to 99,9 % NO!!!

Meaning WHAT ? (trying to leave room for a positive twist here)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

So 11,043.45 of Jos' 11,155 posts were just saying NO!

111.55 YES!

True, isn't it :)

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites

Just add those functions to the end of the _Array.au3 file, then you could use them like "AutoIT base code" (even though _Array.au3 isn't "AutoIT base code" to begin with)

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to post
Share on other sites

Don't think I was joking since it could be I kinda fed up with these snide remarks.

:) what did I wrong this time? He asked for an addition to array.au3 and all I wanted to point out was, if a developer jumps into this thread and answers the questions whether this addition is possible (which you must admit is not guaranteed) then the answer would be 99,9 % No, we won't add this functions.

??? Was that totally wrong? Why shooting at me? :)

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites

Just add those functions to the end of the _Array.au3 file, then you could use them like "AutoIT base code" (even though _Array.au3 isn't "AutoIT base code" to begin with)

Don't add them to the Array.au3 file, next time you upgrade the version you'll lose your additions.

Just make your own file put them in and include that file.

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Link to post
Share on other sites
  • Developers

:) what did I wrong this time? He asked for an addition to array.au3 and all I wanted to point out was, if a developer jumps into this thread and answers the questions whether this addition is possible (which you must admit is not guaranteed) then the answer would be 99,9 % No, we won't add this functions.

??? Was that totally wrong? Why shooting at me? :)

Mega

Lets blame it on our way of interpeting English ..... and yes there is a FAT chance that you won't get a reply when posting in the Support forum.

All proposal in Trac will get a reply and Yes it will be often No for obvious reasons ...

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Lets blame it on our way of interpeting English ..... and yes there is a FAT chance that you won't get a reply when posting in the Support forum.

All proposal in Trac will get a reply and Yes it will be often No for obvious reasons ...

Okay, fine.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...