Jump to content

Array helper function


erifash
 Share

Recommended Posts

Are you tired of this?

$ret = DllCall("somedll.dll", "whatever", "function")
$ret2 = DllCall("anotherdll.dll", "whatever", $ret[0])
Return $ret2[4]
Do you wish you could do this?
Return DllCall("anotherdll.dll", "whatever", DllCall("somedll.dll", "whatever", "function")[0])[4]
Now you can do fancy DLL stuff all on one line with this function!
Func e($aArray, $iElement = 0)
    Return $aArray[$iElement]
EndFunc
I keep the name short to minimize the amount of typing you have to do. The function I have created can turn the above code into this:
Return e(DllCall("anotherdll.dll", "whatever", e(DllCall("somedll.dll", "whatever", "function"))), 4)
The purpose of this function is to minimize the amount of code you have to type if you need quick access to any element in a one-dimensional array. I hope you like it!

Comments or questions are greatly appreciated! B)

Link to comment
Share on other sites

Now you can do fancy DLL stuff all on one line with this function!

Func e($aArray, $iElement = 0)
    Return $aArray[$iElement]
EndFunc
That's awfully ingenious B)

But I still get to type in the awful .DLL call :o

I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

Link to comment
Share on other sites

Thanks! I type medium-fast while coding so long function names aren't really a problem. My friend types so fast he actually skips letters!

Link to comment
Share on other sites

yes i wished i could do that !

did it a long time ago for myself (only it was called r() :o)

(would be cool if autoit actually made it build-in the way you did it in the 2nd box)

and your friend should get a faster keyboard/pc B)

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

(would be cool if autoit actually made it build-in the way you did it in the 2nd box)

Yeah, that would be much nicer. Sadly it would just seem too weird for me. B)
Link to comment
Share on other sites

Yeah, that would be much nicer. Sadly it would just seem too weird for me. B)

Why would it be weird for you?

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...