Search the Community
Showing results for tags 'for next loop'.
-
Need some help understanding why the ConsoleWrite works inside 2nd For loop but not out side. Between Audit Wiki, Help file , Forum searching (lots of code reading), and YouTube ( shout out to TutsTeach), I have not been able to find the reason why. $sIniPath = "installLog.ini" ; - Get section name $iniSctionNames = IniReadSectionNames($sIniPath) ; - Get Keys and Vaules For $a = 1 to UBound($iniSctionNames) - 1 $keys = IniReadSection($sIniPath , $iniSctionNames[$a]) For $b = 1 to UBound($keys) - 1 $oldSysInfo = IniRead($sIniPath , $iniSctionNames[1], $keys[$b][0], "") $PntIPInfo = IniRead($sIniPath , $iniSctionNames[2], $keys[$b][0], "") $NewPCInfor = IniRead($sIniPath , $iniSctionNames[3], $keys[$b][0], "") ;ConsoleWrite($oldSysInfo & @LF) Next ;ConsoleWrite($oldSysInfo & @LF) Next ConsoleWrite($oldSysInfo) My intention is to use the variables later for Listboxes. Any explanation, forum post links or whatever would help. Sorry also very very new to Autoit. Also here's the ini file. [OldSysInfo] 4=192.168.0.4|DESKTOP-RDIU2SN|R90M05Q8 5=192.168.0.5|SD0123456789101|R9WGP9P 6=192.168.0.6|SD0123456789102|R9WGP9PT 3=192.168.0.3|DESKTOP-3RS4LKL|R9WGP9P 23=192.168.0.23|SD0123456789102|MXL1234P5I [PrinterIp] 50=192.168.0.50 48=192.168.0.48 47=192.168.0.47 [NewSysInfo] newPC = SD0123456789adfs|192.168.0.185|2UA1234FTR Thank you for your time.
-
Hi all For the life of me I can't figure out why this doesn't work. The idea is to exit the for/next loop and then use the value of $Stat outside the function. Obviously my understanding of something is deeply flawed, as this does not work as I think it should. global $Stat,$var=3 _Test_Stat() msgbox(0,"Test","The value of $Stat is " & $Stat) Func _Test_Stat() for $Stat = 0 to 5 if $Stat = $var Then ExitLoop EndIf Next EndFunc