Clever1mba Posted June 9, 2005 Share Posted June 9, 2005 hello This code will read file and show all in text file if i need to show only few characters in file then wat to do like text file have my name ASIM ASIM TYPE 70 times in text file now how to show all list of Asim in MsgBox() $file = FileOpen("test.txt", 0); Check if file opened for reading OKIf $file = -1 Then MsgBox(0, "Error", "Unable to open file.") ExitEndIf; Read in 1 character at a time until the EOF is reachedWhile 1 $chars = FileRead($file, 999999) If @error = -1 Then ExitLoop MsgBox(0, "Char read:", $chars)WendFileClose($file)i hope u get my point Link to comment Share on other sites More sharing options...
Valuater Posted June 9, 2005 Share Posted June 9, 2005 not sure exactly what you want... but maybe this dim $cnt="", $Count="70" ; put any number you want here $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 1 character at a time until the EOF is reached While 1 $chars = FileRead($file, 999999) If @error = -1 Then ExitLoop MsgBox(0, "Char read:", $chars) $cnt= $cnt +1 If $cnt>= $Count then $Chars="ASIM" $Cnt="" MsgBox(0, "Char read:", $chars) Endif Wend FileClose($file) mabe it helps 8) 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