Jump to content

Recommended Posts

Posted

Hello scripters :) i got another problem reading all lines in txt file except the last one.

I dont want to write how many lines to read just reading all except the last whatever how many it is.

My efforts:

#include <file.au3>
$file = @ScriptDir & "\x.txt"
$ReadLines = FileReadLine($file)

Local $Read
_FileReadToArray($file, $Read)
For $i = 1 To $Read - 1 ; with-1 or without-1 the result is the same
MsgBox(0, $i, $Read - 1)
Next

Question here: "Why first msgbox title is "1" ? and how can i avoid that?"

#include <file.au3>
$file = @ScriptDir & "\x.txt"
$ReadLines = FileReadLine($file)

Local $Read
_FileReadToArray($file, $Read)
For $i = 1 To $Read
MsgBox(0, $i, $Read[0] -1) ; here in msg's text resolved but in title not :D i think the problem from $i ??
Next

[font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting.

 

[font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color]

[font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font]

Posted

Awesome!!!! it's working !! :)

Thanks somdcomputerguy

[font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting.

 

[font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color]

[font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font]

Posted

Command3r,

To answer your 2ND question: The 2nd parm of MSGBOX is the title. You have $i as the second parm so the title will be whatever the value of $i is.

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted

@kylomas

mmm... you're right ! thanks.:)

@somdcomputerguy

thanks again. ;)

[font="arial, helvetica, sans-serif;"]Advice for you[/font][font="arial, helvetica, sans-serif;"]: [/font][u]Search[/u] before posting.

 

[font="arial, helvetica, sans-serif;"] *********** Problem solved? if yes [/font][color=rgb(0,0,0);font-family:arial, helvetica, sans-serif;] *********[/color]

[font="arial, helvetica, sans-serif;"]******* press "Mark Solved" button. *******[/font]

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...