Jump to content
Sign in to follow this  
confuseman

Array & expansion string

Recommended Posts

confuseman

Hi, newbie to AutoIt.

any idea how to expand variable in string for a single array item. Here is the code

Opt("ExpandVarStrings",1)

Dim $isA[2]$isA[0] = "France"

$isA[1] = "Italy"

Msgbox(0,"Test", "$isA[0]$ vs $isA[1]$") ; Never work

I try to avoid using &, is that possible. Any solution?

:D:wacko::D

Share this post


Link to post
Share on other sites
evilertoaster

as far as i know you must use '&'

Dim $isA[2]

$isA[0] = "France"
$isA[1] = "Italy"

Msgbox(0,"Test", $isA[0]&" vs "&$isA[1])oÝ÷ ØZ½éÞ½êìyéè¯
+çpØZÁ¬­¢)íz¸+j×½ªâi¹^{hjËkx%G­«Dv+@Øhºb*.ßÚÞ­æ¥& j)ì·Zý~ì¢g«y«(*.r¥uÚ,¶b殶­sd÷BgV÷C´WæEf%7G&æw2gV÷C²Ã ¤FÒb33c¶4³%Ð ¢b33c¶4³ÒÒgV÷C´g&æ6RgV÷C°¢b33c¶4³ÒÒgV÷C´FÇgV÷C°¢b33cµFV×Òb33c¶4³Ð¢b33cµFV×#Òb33c¶4³Ð¤×6v&÷ÂgV÷CµFW7BgV÷C²ÂgV÷C²b33cµFV×b33c²g2b33cµFV×"b33c²gV÷C²
Edited by evilertoaster

Share this post


Link to post
Share on other sites
confuseman

Ok thanks. If array not possible in expansion string than I think your method is acceptable.

The reason I want to use array in expansion variable string is because is more tidy code and

can reduce line of code used.

:D:wacko::D

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

what about

Dim $isA[3] = ['',"France", "Italy"]
Msgbox(0,"Test", $isA[1] & " " & $isA[2])

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
confuseman

Hi Mega,

Emm... still got "&" that I want to avoid. But anyway I like your first line.

:D:wacko::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  

×