Jump to content
Sign in to follow this  
birdofprey

Function to return an array with the sub-elements of an object ?

Recommended Posts

birdofprey

Or maybe there's a function I missed out on...

What I want is a way (built in or "to be built by us" function) of returning let's say, an array with all the menu items for a certain menu like this: $array = MenuFunc($menu)

Or an array with the handles of listviewitems... $array = ListViewFunc($listview)... or an array with all the tabs... and so on, a function for any sub somethings of something else.

I'd gladly work out a SubItem_UDF if someone would give me a hint. If necessary...

What do you think ? :)

Share this post


Link to post
Share on other sites
Shevilie

When you create the menus etc you create them in an array and then you don't need the functions :)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites
martin

Or maybe there's a function I missed out on...

What I want is a way (built in or "to be built by us" function) of returning let's say, an array with all the menu items for a certain menu like this: $array = MenuFunc($menu)

Or an array with the handles of listviewitems... $array = ListViewFunc($listview)... or an array with all the tabs... and so on, a function for any sub somethings of something else.

I'd gladly work out a SubItem_UDF if someone would give me a hint. If necessary...

What do you think ? :)

When you create the menu items you could do it with an array from the start

Dim $items[40]

$items[0]=0;say use the zero element for the number of menu items
$item[$item[0] + 1] = GuictrlcreatMenuItem(......
$item[0] += 1

Isthat any use?

Edit: Whoops, overlapped with Shevillie

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.

Share this post


Link to post
Share on other sites
birdofprey

Thanks, you see what happened is that I declared those subitems before I was aware that I'll need to turn them into an array. And then I wished: "If I only could call these subitems by using the mother item...", like "first menu item of a certain menu..." I was hopping for a GuiCtrlGetSubItems or something, but I couldn't find anything in the help file.

If no one else has any ideas, then... I guess it will all come down to one thing: getting used to the good habit of declaring sub items of anything in an array from now on.

Share this post


Link to post
Share on other sites
Shevilie

If no one else has any ideas, then... I guess it will all come down to one thing: getting used to the good habit of declaring sub items of anything in an array from now on.

Yep... Thats the thing to do :)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

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.