Sign in to follow this  
Followers 0
randall

Extending Array functionality

6 posts in this topic

Hi,

My compliments for the great language.

I started using it for macros, then realised the speed and ease of use, so i started using it also for the modelling in my PHD work. It is great indeed, i can generate data files from the program, and the call other little free programs like gnuplot to manipulate the data. Anyway.

I soon realised that I needed more support for array manipulation, so i set off to write some UDFs to make this possible, the little time investment went a long way.

The question is:

Do you want me to tidy up this code, credit the snippets I used from the help and the old UDFs and send you a little pack of functions for 2d array manipulation?

I realise this is mostly a language for macros, but it is very good and I thought you might want to provide a little section on the site with little UDF files kinda like plugins for whoever might want to extend functionality in the way they wish, perhaps the main developers could pick and match good functions and stick them into packages for everybody to use

For now the main function is one that adds variables to an array, and if the address is out of bound it extends the array to be able to include the value in the said place.

I would be honoured to contribute to your great project, so let me know.

Share this post


Link to post
Share on other sites



there is a file called array.au3 wich has _ArrayAdd() :D

maybe i was not clear, not everyone gets my way of explaining things (i.e. I am rubbish at explaining things)

Function Name: _ArrayAdd()

; Description: Adds a specified value at the end of an array, returning the

; adjusted array.

mine is a function of the sort add(element, byref array, row column)

this way you can populate an array in whatever way you want. Then you can use the row and the column (2d for now) to index your info.

For example you can have a [6][5] array and keep X,Y,Z,yaw,pitch,roll along dim1 and have this info about 5 objects along dim2, then you can say: what is the Z position of object 4?

the answer is [2][3].

I also have a very handy function that prints the contents of the array (and it is not like array display cause it can do 2d!!!)

This however is just the beginning, some people use arrays all the time when programming, and more support for doing so is certainly useful. There is also scope for implementing linear algebra functions (basic ones to start with) and this is certainly best done by making libraries of very fast running code using mingw

and then encapsulating their usage with some nice autoit UDFs so that it feels like autoit, but it really is optimised and compiled C.

All of this making sure that the beautiful simplicity of autoit is conserevd perhaps by keeping these things somewhere here or on the site away for the rest of the stuff with separate help files so as not to waste the time of the people that would like to write simple scripts without having to read miles of help files written by nerds that can't explain themselves and won't even post an example snippet of code... sorry rambling

In anycase I love autoit and I want to use it for stuff that it is not yet ready for, and I will be writing code to do that, if people care i will share it.

Share this post


Link to post
Share on other sites

Welcome aboard Randall

If you feel your UDF's will assist others, always feel free to post them in the scripts & scraps forum, and link to them in your signature like many others do.

You will be better able to guage the popularity & usefulness by other users comments & suggestions.

If you thought the need was there to create them, you can be assured another user somewhere is waiting to use them.

Good work

HardCopy


Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Share this post


Link to post
Share on other sites

Allright, next week i am going to get a few things from randallc, and I will get cracking, I will be asking everybody for opinions as to what is the most straight forward and easiest to understand syntax for array ops. I have been using Matlab for ages and I think I might be biassed in that way. I do however remember it was a little confusing at first.

So this goes especially to the developers that did such a wonderful job of keeping the language accessible to everyone: Have a think and let me know

Then we can ask the less experienced people if they think it looks easy enough :D

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  
Followers 0