Valnurat Posted July 29, 2015 Share Posted July 29, 2015 Hi.I'm trying to do the following:#include <MsgBoxConstants.au3> Local $i, $Var0 = "Check", $Var1 = "this", $Var2 = "out", $Var3 = "girls." For $i = 0 to 3 MsgBox($MB_SYSTEMMODAL,"Strings",$Var[$i]) NextBut I get this error:warning: $Var: possibly used before declaration. MsgBox($MB_SYSTEMMODAL,"Strings",$Var[$i])~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^error: $Var: undeclared global variable. MsgBox($MB_SYSTEMMODAL,"Strings",$Var[$i])~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ How can I fix this? Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
Danyfirex Posted July 29, 2015 Share Posted July 29, 2015 Do something like. #include <MsgBoxConstants.au3> Local $i, $Var0 = "Check", $Var1 = "this", $Var2 = "out", $Var3 = "girls." For $i = 0 to 3 MsgBox($MB_SYSTEMMODAL,"Strings",Execute("$Var" & $i)) Next So a more elegant way should be using array.#include <MsgBoxConstants.au3> Local $i, $Var[] = ["Check", "this","out", "girls."] For $i = 0 to 3 MsgBox($MB_SYSTEMMODAL,"Strings",$Var[$i]) NextSaludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Valnurat Posted July 29, 2015 Author Share Posted July 29, 2015 Thank you. Yours sincerely Kenneth. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now