Gif Posted July 31, 2007 Share Posted July 31, 2007 ok here is the problem that pisses me off when my program is not compiled this command: _FileCountLines($Ose) returns the number of the file ive created without the extra one that is being added alone , so the return is 10 (the file is 11 lines but the last one is empty) and works perfectly but when i compile the script _FileCountLines($Ose) returns 11 and even if i try to do _FileCountLines($Ose) - 1 it does the same thing !!!!!how to resolve that???it tried several workarounds but yet nothing....PLEASE HELP Link to comment Share on other sites More sharing options...
DW1 Posted July 31, 2007 Share Posted July 31, 2007 but when i compile the script _FileCountLines($Ose) returns 11 and even if i try to do _FileCountLines($Ose) - 1 it does the same thing !!!!!That doesn't make any senseI understand that the 'running in Scite' and 'running compiled exe' return different values but the above statement is throwing me off. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
DW1 Posted July 31, 2007 Share Posted July 31, 2007 can you post a script to reproduce this issue? AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 31, 2007 Share Posted July 31, 2007 Hi, #include<file.au3> Dim $aRecords _FileReadToArray('c:\found.txt',$aRecords) MsgBox(0,':::::::::::::' & UBound($aRecords), _FileCountLines('c:\found.txt')) FileReadToArray works. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Gif Posted July 31, 2007 Author Share Posted July 31, 2007 i saw _filereadtoarray() but is a way bigger situation, i have about 10 stringsplit() and more again the main problem is that _FileCountLines() returns the number of lines of file without THE LAST EMPTY ONE if not compiled but if compiled it returnsall the lines including the empty onethe file is like this:LINE 1 LINE 2 LINE 3 LINE 4 LINE 5 LINE 6 LINE 7 LINE 8 LINE 9 LINE 10 -empty line-so uncompiled script returns 10 and compiled 11PS:if i could remove that empty line... Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 31, 2007 Share Posted July 31, 2007 (edited) Hi, #include<Array.au3> #include<File.au3> Global $pfad = @ScriptDir & '\leerzeilen.txt', $lines_A _FileReadToArray($pfad, $lines_A) For $i = UBound($lines_A) - 1 To 1 Step - 1 If Not StringRegExp($lines_A[$i], '[^\s]', 0) Then _ArrayDelete($lines_A, $i) Next _FileWriteFromArray($pfad, $lines_A, 1) #include <Array.au3> #include <File.au3> Global $aSource Global $path = "leerzeilen.txt" If Not _FileReadToArray($path, $aSource) Then MsgBox(0, 'Achtung', "Datei konnte nicht eingelesen werden!") Exit EndIf _ArrayDisplay($aSource, "before...") Global $tmp[1] For $i = 1 To $aSource[0] If $aSource[$i] <> "" Then _ArrayAdd($tmp, $aSource[$i]) Next $tmp[0] = UBound($tmp) _ArrayDisplay($tmp, "after !") So long, Mega Edited July 31, 2007 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Gif Posted July 31, 2007 Author Share Posted July 31, 2007 (edited) omg i fixed it EDIT:saw that now mega, its ok i fixed that problem Edited July 31, 2007 by c4nm7 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