Sign in to follow this  
Followers 0
Orca

Arrays

3 posts in this topic

Okay I'm not new to the coding scene, been doing some fun autoit apps recently.

I have extensive PHP background...

Now I'm working on a verification function that gets a checksum and compares it to all the values in array $checksumVal[1-n]

It returns a string.

Now in php I could simply set $arrayStuff['text'] = 1 and do if($arrayStuff[$stringVarFromOtherArray]==1)

{

stuff();

}

(of course autoit syntax is a bit different)

Okay now that I've thourougly explained this as poorly as I can...

... How can I set a value to a string array location instead of a decimal location

$array['string'] instead of $array[4]


I AM ORCA!! A VERY POWERFUL WHALE!!!

Share this post


Link to post
Share on other sites



You can't. String indexes are not supported for AutoIt arrays. You could have a function that evaluates the string somehow and returns an integer, but then you're going to have a list comparing strings to numbers.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

string($int) = $string :D I ended up doing it a painful way... Though for users to config it.. It's ugly

Can you use vars in stringsplit?

$var1 = 0

$var2 = 0

$var3 = 1

$array = stringsplit('|'&$var1&'|'&$var2&'|'&$var3&'|', '|')

Something like that? Or would I need to make all the vars strings first?

BTW I love your tag!

On php freaks I usually just respond

Sometimes I link to a subpage.. :D PHP and AutoIT have amazing manuals... :)

Edited by SiC_Goat

I AM ORCA!! A VERY POWERFUL WHALE!!!

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