Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

ElseIf and more than, less than?

$
0
0

Can someone tell me what Im doing wrong in this script?

AutoIt         
Local $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then     MsgBox(0, "Error", "Unable to open file.")     Exit EndIf ; Read in 4 character at a time until the EOF is reached While 1     Local $chars = FileRead($file, 4)     If @error = -1 Then ExitLoop WEnd FileClose($file) If $chars > 10 Then     MsgBox(0, "Char read:", "Yes") ElseIf $chars < 10 Then     MsgBox(0, "Char read:", "No") EndIf Exit

The number in the .txt is 22 but I get MsgBox with "No"

 

Thanks guys!


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>