Nullsoft Install System is the best. But when I had been writing
one script I could not do some string operations. I started to try
various functions, but unfortunately they were narrowly - directed and
some of them hanged during testing it I think inadmissible.
For this reason I wanted to write universal function on which other
functions can be based and wrote "WordFind".
Recently I have finished creation of a header file which includes
the following functions (with many examples):
1. WordFind (un.WordFind)
2. WordReplace (un.WordReplace)
3. WordAdd (un.WordAdd)
4. WordFind2X (un.WordFind2X)
5. StrFilter (un.StrFilter)
6. CopyToClipboard (un.CopyToClipboard)
7. CopyFromClipboard (un.CopyFromClipboard)
I shall be grateful if you will estimate the done job. 🙂
String Function Header: "WordFunc.nsh"
30 posts
Nice 😉
I should use the clipboard functions! 🙂
I should use the clipboard functions! 🙂
CopyToClipboard & CopyFromClipboard are written by Afrow UK.
I think you should use a macro system with the functions...
E.g.
E.g.
In their script, one would use:!macro StrStr TheString SearchFor
Push ${TheString}
Push ${SearchFor}
Call StrStr
!macroend
-Stu!insertmacro StrStr "hello" "el"
Pop $R0 ;$R0 == "ello"
That is offered is was the first version of a file: recurrence of identical functions, but with different names without un. and with un. But I do not like the big files especially if it is possible to make less. If I have correctly understood (English not the native language).
deguix made a StrFunc NSIS header file (it will be in your include folder) which you could always update with the new functions (or ask him to update it even).
-Stu
-Stu
I know about Deguix StrFunc NSIS header file.
1) His macros have no uninstall. 🙁
2) From all functions in his header file at all my respect I can allocate only your clipboards, NSISToIO and IOToNSIS.
1) His macros have no uninstall. 🙁
2) From all functions in his header file at all my respect I can allocate only your clipboards, NSISToIO and IOToNSIS.
@AfrowUK
I was thinking to awnser before you about updating StrFunc.nsh.
@Instructor
1) They have uninstall.
2) Doesn't matter what you use the most. Sometimes neither I use it. It's only a selection of functions. I was thinking on your header file to make some changes to StrFunc.
I'll say more at night, 'cause right now I don't have time to awnser.
I was thinking to awnser before you about updating StrFunc.nsh.
@Instructor
1) They have uninstall.
2) Doesn't matter what you use the most. Sometimes neither I use it. It's only a selection of functions. I was thinking on your header file to make some changes to StrFunc.
I'll say more at night, 'cause right now I don't have time to awnser.
I apologize, if is valid StrFunc has uninstall macros (I have only the version included in NSIS 2.0).
For new version of WordFunc.zip
For new version of WordFunc.zip
It's giving a foreign language 404 html error...
Now this is the time...:
You did a great job on doing all that. I really should stop my vacation on the StrFunc development now.
I see that you have some ideas on the header file itself:
- !define _UN1 when using uninstaller functions.
One thing to improve here is that you could make a smaller header file using this below as an example:
And I did test your functions, they are in great shape, but we need to make sure that it doesn't have any bugs. Using that program of yours it will be much easier.
Now a list of planned things for StrFunc.nsh 1.07:
- I'll examinate your first 5 functions in your header file for bugs, if they have, I'll call you here. If not, they'll be included.
- Did you see my first suggestion here? StrFunc has a problem like it. I should fix it.
- An example program like yours (kichik told me before to do a different example program than just a simple test).
Because I already promissed the InstallOptionsEx new version soon, I'll start working on StrFunc only after that plugin launchment.
Ok, that's all for now. See you soon.
Now this is the time...:
You did a great job on doing all that. I really should stop my vacation on the StrFunc development now.
I see that you have some ideas on the header file itself:
- !define _UN1 when using uninstaller functions.
One thing to improve here is that you could make a smaller header file using this below as an example:
- It doesn't have a command to separate commands for install and uninstall functions. Makes more lines of code (inside header file), but makes easier for the user.!macro un.CommandCall Parameters
!define _UN1
!insertmacro CommandCall ${Parameters}
!undef _UN1
!macroend
!macro CommandCall Parameters
# A normal command call
!macroend
And I did test your functions, they are in great shape, but we need to make sure that it doesn't have any bugs. Using that program of yours it will be much easier.
Now a list of planned things for StrFunc.nsh 1.07:
- I'll examinate your first 5 functions in your header file for bugs, if they have, I'll call you here. If not, they'll be included.
- Did you see my first suggestion here? StrFunc has a problem like it. I should fix it.
- An example program like yours (kichik told me before to do a different example program than just a simple test).
Because I already promissed the InstallOptionsEx new version soon, I'll start working on StrFunc only after that plugin launchment.
Ok, that's all for now. See you soon.
I don't understand your code.
"!define _UN1" (_UN1 is already defined)
Do you mean:
"!define _UN1" (_UN1 is already defined)
Do you mean:
If yes, then the size on the contrary will increase.
!macro un.CommandCall Parameters
!undef _UN1
!define _UN1 `un.`
!insertmacro CommandCall ${Parameters}
!undef _UN1
!define _UN1
!macroend
!macro CommandCall Parameters
Push ...
Push ...
Call {_UN1}Command
Pop ...
Pop ...
!macroend
Can you explain if not difficultly:
"- It doesn't have a command to separate commands for install and uninstall functions."
"- It doesn't have a command to separate commands for install and uninstall functions."
No, it should be:
macro un.CommandCall Parameters
!define _UN1 `un.`
!insertmacro CommandCall ${Parameters}
!undef _UN1
!macroend
This is simple, because _UN1 will start off undefined, be defined for the CommandCall, and then be undefined again (for another CommandCall)
-Stu
macro un.CommandCall Parameters
!define _UN1 `un.`
!insertmacro CommandCall ${Parameters}
!undef _UN1
!macroend
This is simple, because _UN1 will start off undefined, be defined for the CommandCall, and then be undefined again (for another CommandCall)
-Stu
Can you explain if not difficultly:In other words, it has commands like ${WordFind} and ${un.WordFind}.
"- It doesn't have a command to separate commands for install and uninstall functions."
StrFunc has commands like ${StrStr}, ${UnStrFunc} (to separate inst from uninst) and ${StrStr} again.
(I call ${WordFind} a command, not a function or macro.)
! include WordFunc.nsh
### _UN1 should be defined all over again up to###
!insertmacro WordFunction
Section
$ {WordFunction}...
SectionEnd
Unfortunately I do not see it more simple decision. Whether can you write an example with one function.
### _UN1 should be defined all over again up to###
!insertmacro WordFunction
Section
$ {WordFunction}...
SectionEnd
Unfortunately I do not see it more simple decision. Whether can you write an example with one function.
I didn't want you to change that, I was just saying that that is different, and I liked it. (sorry if I didn't say it before)
I'll launch InstallOptionsEx beta 6 now, so I can work on StrFunc.nsh starting right now. Is that first file your latest file version? Can I begin the development now?
I'll launch InstallOptionsEx beta 6 now, so I can work on StrFunc.nsh starting right now. Is that first file your latest file version? Can I begin the development now?
The previous message has been addressed for Afrow UK.
I discuss with you and with Afrow UK in a that occasion that you have suggested to simplify a header file, but yet has not found out how this simplification can be expressed.
I spread last version constantly here Download
I discuss with you and with Afrow UK in a that occasion that you have suggested to simplify a header file, but yet has not found out how this simplification can be expressed.
I spread last version constantly here Download
I spread last version constantly hereFor me you hosted a file on a host that doesn't reach the United States, so I can't download it. Please, attach the file here.
...
Thanks. It's like what happened when I was on Brazil trying to download HM NIS Edit. I couldn't get it from there. I just knew and used that program only here in United States.
Good remark.
With what program you download a file?
With what program you download a file?
I use Internet Explorer. It's just because USA is so far from Russia that he couldn't get the download. I could though as I am a little closer.
-Stu
-Stu
I know it, but for example Opera (at me 7.23) also refuses to download a file.
Oh... you mean you can't download it if you follow the link? Well I tried it and it came up with a page with loads of strange characters (I guess it's Russian), but there was a big link on there with the download URL (but in funny characters). I clicked on that and it downloaded.
-Stu
-Stu
On the next time, try to at least to have a page in English. I can't understand anything. The real thing is that it reaches here but I didn't know were to click.
Now about the functions, I included the Word* functions (I won't launch it right now), but I just wanted to tell you to make a smaller version of StrFilter without the Upper case and Lower case options. Because I already have one function totally for this subject.
And another thing, you could add an ability to filter the characters the user wants. But you don't need to do this right now.
And another thing, you could add an ability to filter the characters the user wants. But you don't need to do this right now.
I'd like to have some of your functions in the better shape as possible for the people (as I said before). You don't imagine how tested the functions that are included with StrFunc.nsh within NSIS are. As NSIS is in a stable version, we test everything we can...
I know, you've done a good job, but we need it to be a "perfect" job. As I had to do before. So that's why I'm asking more favors from you now:
- General:
- Don't try to compress every option and, for example, words to add under one parameter, try to expand it into several parameters so makes the input more organized (for the user).
- Try to make an error handler like NSIS do, it never outputs like a parameter, but it uses the command "SetErrors". Only in much complicated matters is used another return value for errors (like InstallOptions).
- Try to make it accept the String without separators. That means "String" should have the minimum of 1 word (not 2 as now it is).
- Make output parameters as the first, then the input ones.
- As all the functions are ${WordFind} dependant, you could make them with more options, like the ${WordFind} itself.
- Learn to use default values for the parameters, like in ${WordAdd} the "Delimiter" parameter could have a value when it is empty.
Don't be mad at me just by that, when I started nor even English I did understand well, now after about two years using NSIS (I'm member here since Dec, 2002, but I used NSIS since Aug, 2002) I have two projects that I'm working right now, and other several functions, but most of them I kept abandoned.
(Sometimes you can see me as a perfectionist, that's because I'm an user and a developer at the same time.)
I know, you've done a good job, but we need it to be a "perfect" job. As I had to do before. So that's why I'm asking more favors from you now:
- General:
- Don't try to compress every option and, for example, words to add under one parameter, try to expand it into several parameters so makes the input more organized (for the user).
- Try to make an error handler like NSIS do, it never outputs like a parameter, but it uses the command "SetErrors". Only in much complicated matters is used another return value for errors (like InstallOptions).
- Try to make it accept the String without separators. That means "String" should have the minimum of 1 word (not 2 as now it is).
- Make output parameters as the first, then the input ones.
- As all the functions are ${WordFind} dependant, you could make them with more options, like the ${WordFind} itself.
- Learn to use default values for the parameters, like in ${WordAdd} the "Delimiter" parameter could have a value when it is empty.
Don't be mad at me just by that, when I started nor even English I did understand well, now after about two years using NSIS (I'm member here since Dec, 2002, but I used NSIS since Aug, 2002) I have two projects that I'm working right now, and other several functions, but most of them I kept abandoned.
(Sometimes you can see me as a perfectionist, that's because I'm an user and a developer at the same time.)
... make a smaller version of StrFilter without the Upper case and Lower case options. Because I already have one function totally for this subject.I think there is no necessity to change idea of function and the more to reduce an opportunity.
And another thing, you could add an ability to filter the characters the user wants.The concrete example is necessary for me (What string is given? What it is necessary to make?).
I'd like to have some of your functions in the better shape as possible for the people...Do you mean comments?
- Don't try to compress every option and, for example, words to add under one parameter, try to expand it into several parameters so makes the input more organized (for the user).How many people are so much and opinions. I see it as have made (simple, organized, compact).
- Try to make an error handler like NSIS do, it never outputs like a parameter, but it uses the command "SetErrors". Only in much complicated matters is used another return value for errors (like InstallOptions).It is simple to do. The offer: SetErrors for errorlevel 1-4.
- Try to make it accept the String without separators.What sense? What tasks can be solved thus?
That means "String" should have the minimum of 1 word (not 2 as now it is).There is minimum = 1 word + delimiter ([Word][delimiter], but not [word])
- Make output parameters as the first, then the input ones.If it is critical that I can change it. Though it is more habitual for me by analogy to use of functions:
Push "..."
Push "..."
Call Function
Pop $var1
Pop $var2
- As all the functions are ${WordFind} dependant, you could make them with more options, like the ${WordFind} itself.The concrete example is necessary for me (What string is given? What it is necessary to make?).
- Learn to use default values for the parameters, like in ${WordAdd} the "Delimiter" parameter could have a value when it is empty.All values required I don't want to change it (There are no those parameters which it is possible to name by default).
I in any case do not become angry. I am glad, that there are people which express the opinion. 🙂
- Try to make an error handler like NSIS do, it never outputs like a parameter, but it uses the command "SetErrors". Only in much complicated matters is used another return value for errors (like InstallOptions).Sorry has not closely read.
I have thought that you have suggested to add besides errorlevel parameter also command SetErrors.
I want to tell, that errorlevel serves for the greater concrete definition of mistakes (you are itself understand it) which it is possible and it is necessary to use (Examle.nsi).
I think there is no necessity to change idea of function and the more to reduce an opportunity.OK, no problems at all.
The concrete example is necessary for me (What string is given? What it is necessary to make?).Hmmm... I was saying about the function StrFilter. That's because it now has an option to choose between letters, numbers and other types, but it doesn't accept the characters you want.
This would be great for path names (like "C:\Program Files") to filter characters like "*" which you cannot put.
How many people are so much and opinions. I see it as have made (simple, organized, compact).OK, no problems.
What sense? What tasks can be solved thus?Hmmm... Ignore my message, I sometimes post so fast that actualy I put non-sense things to the post.
There is minimum = 1 word + delimiter ([Word][delimiter], but not [word])Could you include at least this change, please?
If it is critical that I can change it. Though it is more habitual for me by analogy to use of functions:Oh man, where I did hit my head that day...
Sorry if I didn't say, but I was saying about the functions.- As all the functions are ${WordFind} dependant, you could make them with more options, like the ${WordFind} itself.The concrete example is necessary for me (What string is given? What it is necessary to make?).
All values required I don't want to change it (There are no those parameters which it is possible to name by default).OK, I can do it.
I want to tell, that errorlevel serves for the greater concrete definition of mistakes (you are itself understand it) which it is possible and it is necessary to use (Examle.nsi).Yep.
I asked all that because some of them are better to be changed in the function itself if you can do it. If you can't, no problems.