New Array Functions

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

New Array Functions

Post by mightycpa » Thu Mar 26, 2015 3:32 pm

Hi,

I've scoured the technical forum, and found a interesting workaround, but some straightforward commands would work best. I searched the enhancements, didn't find anything, although I know the people want these:
  • 1) Pass an entire array to SRT
    2) Copy a recordset array into a regular array (not sure what the difference is, but ArrayCount will show you there's a difference)
    or
    Pass an entire recordset array to SRT
    or both
    3) I like PepsiHog's idea of UnSeparate (Aggregate?), but I wonder how that would work with arrays with more than one dimension (like a recordset). Anyway, I second that suggestion too.
    4) Ability to get the Array element name
    5) Ability to get the Recordset Array element name (VBScript, I know, I know)
I find that my ability to create subroutines is hampered without these array/database functions. For example, I've tried to create many reusable SRT's, like QUERY_TO_CSV, QUERY_TO_INSERT, QUERY_TO_UPDATE, but the lack of the abilities mentioned above puts me out of business for now.

Sorry if I've duplicated any previous requests.

Thanks once again for the produce. It's saving me tons of tedious work.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: New Array Functions

Post by Marcus Tettmar » Mon Mar 30, 2015 12:07 pm

Hi,

There's no way to pass arrays to subroutines, at least not so that they become local variables.

But subroutines can access global variables. So you can still have a subroutine that does something to an array. If you didn't want to affect the array globally, you could perhaps have the subroutine make a copy of it. You could pass the array name and the count to the subroutine as two parameters and it could then use these to make a copy of the variable to a local array.

But if the purpose is to modify the array anyway then you do not need to pass anything.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts