Advanced :) search in a text file
Your comments and remarks, please:
Advanced search in text file
Archive: Advanced :) search in a text file
Advanced :) search in a text file
Your comments and remarks, please:
Advanced search in text file
Hi WarmAr :)
1) First of all, welcome to the forums :)
2) Then, thanks for your contribution...
Well, there is another search function you could check, written by Afrow UK. It ouputs also the number of times the string has been found in the file, and the number of lines.. but it doesn't make the difference between commented and uncommented lines. Maybe you could "merge" the features...
The function can be found here:
http://nsis.sourceforge.net/archive/...b.php?page=315
3) About the parameter "dummy"
I don't know how in another way to get the necessary order of the stack elementsWell, your 'exch' instructions should look like this:
SearchInFile
Exch$3 ; search mode
Exch 3
Exch$2 ; file handle
Exch 2
Exch$1 ; comments delimiter
Exch
Exch$0 ; search sample
>; ...
Pop $3
Pop $2
Pop $1
Pop $0
FunctionEnd
>
Push $handle
Push '#'
>Push 'gds_db'
>Push 'no'
Call SearchInFile
Pop$0
>
And "dummy" has disapeared :DThanks for remarks! I shall bring in changes to function by the end of the next week
Hi again !
Thanks for remarks!You're more than welcome :)
here is no need to pass the file handle to the function trough the stack, you could open the file in the function itself.. the less parameters, the betterI disagree. If don't push the handle it is necessary to push the filename. Here there are no less parameters :)
Hi WarmAr :)
I disagree. If don't push the handle it is necessary to push the filename. Here there are no less parametersIt's true, I probably wasn't fully awake at the time I wrote the post :D
Why the handle, instead of filename? Before working with file it is necessary to check up still its existence, to check up an opportunity of it to open. All this does not concern to search in file, we shall take out of context.Well, it depends actually, there are several ways..
evilO, thanks for help in mastering operations with stack!
I have edited function.
In addition to suggested by you changes I have added some more 'Exch' for the purposes of the standard order of the initial registers values in a stack