Jump to content

Quick question about datatypes in AutoIt


Recommended Posts

Hi all,

Can we define our own datatypes for AutoIt? What I'm looking to do is associate multiple values for one variable but can't find anything in the AutoIt help file. I could use an array since the datatypes are probably the same but it won't look as nice. Basically I'm looking for something that would do the equivalent of class and struct in C/C++.

If AutoIt has some language construct to allow for this then I can code like:

$foobar.x = something here

$foobar.y = something here

Rather than code like this which isn't as nice:

$foobar[0] = something here

$foobar[1] = something here

Thanks

Edited by Greatwolf
Link to comment
Share on other sites

You could use DllStructs. They're just the same as C style structs.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

Thanks for the reply. I'll check out Dllstructs and see how to use it.

I dunno if what i'm looking for is really object-oriented per say. I mean it doesn't have anything to do with say including member functions or having member scope enforcement inside the datatype. All I'm looking to do here is to find a way to have a datatype be able to have multiple components and also for code readability.

Thanks

Link to comment
Share on other sites

Thanks for the reply. I'll check out Dllstructs and see how to use it.

I dunno if what i'm looking for is really object-oriented per say. I mean it doesn't have anything to do with say including member functions or having member scope enforcement inside the datatype. All I'm looking to do here is to find a way to have a datatype be able to have multiple components and also for code readability.

Thanks

there are no C-like structures in AutoIT. Just arrays, strings and "numbers".

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Use a COM vbscript collection (Search for ObjCreate). Then you can awoid the array syntax. ptrex also have a tutorial on wsc in scripts that should enable you to use this syntax. The tradeof is that it ain't pure AutoIt anymore :P

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...