ZebrasInBlankets Posted May 25, 2005 Posted May 25, 2005 expandcollapse popup#include <File.au3> HotkeySet("!1", "testdb") while 1 sleep(100) wend Func testDB() $in_filename = "test.csv" Dim $lines,$Display, $NumCols _FileReadToArray($in_filename, $lines) $Columns = StringSplit($lines[1], ",") $NumCols=$Columns[0] Dim $array[ $lines[0] ][ $Columns[0] ] For $i = 1 To $lines[0] $Columns = StringSplit($lines[$i], ",") If $Columns[0] = 1 Then Continueloop For $j = 1 To $Columns[0] $array[$i-1][$j-1] = $Columns[$j] Next Next $Rows=$Lines[0]-1 $num_id = 12345 $p = 0 while 1 if $array[$p][0] = $num_id then if $array[$p][2] = 1 then DoIt() else Send("{ESC}") endif exitloop else $p = $p + 1 ContinueLoop endif wend EndFunc Func DoIt() Sleep(2500) Send("{F8}") EndFunc OK, what I want to do is: If $numid is not in the csv/array then DoSomethingElse. I tried numerous times with no avail. Any help is greatly appreciated..
PerryRaptor Posted May 25, 2005 Posted May 25, 2005 I would suggest that you do something with $Rows. If $Rows = $p then you're out of records in the CSV file. Using this logical condition would allow you to end the While/Wend loop and do something else.
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