Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   FileSearch function (http://forums.winamp.com/showthread.php?t=256928)

TJK 5th October 2006 16:25

FileSearch function
 
Hi

I think I have found a problem in the FileSearch function - on exit $0 and $1 variables are swapped when compared on their settings on entry to the function.

I think that this can be fixed by changing the end of the FileSearch function from:
Quote:

Exch $2 ;output number of lines
Exch 2
Exch $1 ;output yes/no
Exch
Exch $0 ;output count found
FunctionEnd
to:
Quote:

Exch $2 ;output number of lines
Exch 2
Exch ; Add this line
Exch $1 ;output yes/no
Exch
Exch $0 ;output count found
FunctionEnd
Regards

Tim

Animaether 6th October 2006 09:14

I concur - I've edited the wiki.

However, rather than your proposal, I've made it this:
code:

Exch $2 ;output number of lines
Exch
Exch $1 ;output yes/no
Exch 2
Exch $0 ;output count found
FunctionEnd


Which will have the same effect, but is an op less.

ssam 3rd July 2008 08:19

Use FileSearch
 
http://nsis.sourceforge.net/Search_for_text_in_file

there i found how can i use the function

http://forums.winamp.com/showthread....ght=FileSearch

there i saw how to call the function

but i get the error: "Error resolving function "FileSearch"


here is my code:

code:

.
.
.
Push '$Apache_Path_to_Verify\conf\httpd.conf'
Push $specificInstallerString
Call ${FileSearch}
Pop $0 #Number of times found throughout
Pop $1 #Number of lines found on

StrCmp $0 0 ApacheConf_alreadypatched
.
.
.


Afrow UK 3rd July 2008 10:35

Check the usage on that page.

Stu


All times are GMT. The time now is 17:32.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.