Jump to content
Sign in to follow this  
marselo

returning an array from a function

Recommended Posts

marselo

i have a function, that needs to return an array. how can i do that?

Share this post


Link to post
Share on other sites
UEZ

Here a very simple example:

#include <Array.au3>
$array = Create_Array()

_ArrayDisplay($array)

Exit

Func Create_Array()
    Local $aCreate[10]
    Local $x
    For $x = 0 To UBound($aCreate) - 1
        $aCreate[$x] = Random(0, 100, 1)
    Next
    Return $aCreate
EndFunc

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
marselo

i dont really know the max index of the array, so how can i return an array with the exact index?

Share this post


Link to post
Share on other sites
UEZ

i dont really know the max index of the array, so how can i return an array with the exact index?

Look in help file for UBound().

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.