Jump to content

Autoit Syntax for Declaring and Initializing Array


blahole
 Share

Recommended Posts

Hi,

Does anyone know the correct syntax I would use to convert the following C++ code to Autoit?

static unsigned short asso_values[] =

{

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 97, 5,

0, 25, 10, 15, 115, 65, 4, 2, 85, 95,

25, 5, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308

};

I've tried a bunch of syntax and looked in the documentation, but it doesn't seem to work. Can you declare and initialize arrays in Autoit? Here's what I have:

Global $asso_values[] =

(

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 97, 5,

0, 25, 10, 15, 115, 65, 4, 2, 85, 95,

25, 5, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

308

)

Any help would be really appreciated!

Thanks!

Link to comment
Share on other sites

Anyone know if this is do-able? I know I can do it but declaring the array and then setting each individual element, but that would be kind of a hassle and it wouldn't look very nice. Anyone know how to do it better?

Thanks!

Hi,

Does anyone know the correct syntax I would use to convert the following C++ code to Autoit?

  static unsigned short asso_values[] =

    {

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308,  97,  5,

        0,  25,  10,  15, 115,  65,  4,  2,  85,  95,

      25,  5, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

      308

    };

I've tried a bunch of syntax and looked in the documentation, but it doesn't seem to work. Can you declare and initialize arrays in Autoit? Here's what I have:

Global $asso_values[] =

(

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308,  97,  5,

    0,  25,  10,  15, 115,  65,  4,  2,  85,  95,

  25,  5, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308, 308, 308, 308, 308, 308, 308, 308, 308, 308,

  308

)

Any help would be really appreciated!

Thanks!

<{POST_SNAPBACK}>

Link to comment
Share on other sites

Alright thanks, I'll just do it the old fashioned way then. :lmao:

<{POST_SNAPBACK}>

Put your large string in a file, read it in to autoit, get rid of the white space, then use stringsplit($var,",") since everything's separated by a comma.

after that stringsplit, the variable will be an array.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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