Hi Deguix !
Thanks for the quickness of your answers, I'm sorry I couldn't test your fix earlier but I was away 'til this morning..
Well, everything seems to work fine as far as I have tested... 🙂 I'm glad you got this header file working, these functions will really help (plus I'm creating a header file as well and now I know how to design it efficiently 😛).
Thanks a lot for your efforts 👍 !!
evilO/Olive
PS: about your tests I've no idea whether a mark above 100 is good or not (but I assume it is otherwise you wouldn't have written it 😁 ), as in France the range is from 0 to 20 ...
string functions
117 posts
Version 1.03 has been uploaded to CVS.
Maybe in future it can be more than just a header file of string functions...
[About Tests:]
In Brazil the range is from 0 to 10, or are letters P (10), S+ (7.5), S (5), S- (2.5), and NS (0) or are letters PS (10), S+ (7.5), S (5), S- (2.5), and I (0) (maybe it has more).
In U.S.A. the range is from 0 to 100 which results in the letters A+(97-100) A(93-97) A-(90-93) B+(87-90) B(83-87) B-(80-83) C+(77-80) C(73-77) C-(70-73) D+(67-70) D(63-67) D-(60-63) F(0-60) E(didn't complete the course objectives).
Maybe this is interesting:
In Sao Paulo city, because have a lot of people, and so the schools are crowded, there has a law that you can pass grades 1-7 with the worst score. I don't remember when they launched that law (1997 or 98), but I know when you do that, you go to "summer school", and they pass you to the next grade after.
[About Tests:]
In Brazil the range is from 0 to 10, or are letters P (10), S+ (7.5), S (5), S- (2.5), and NS (0) or are letters PS (10), S+ (7.5), S (5), S- (2.5), and I (0) (maybe it has more).
In U.S.A. the range is from 0 to 100 which results in the letters A+(97-100) A(93-97) A-(90-93) B+(87-90) B(83-87) B-(80-83) C+(77-80) C(73-77) C-(70-73) D+(67-70) D(63-67) D-(60-63) F(0-60) E(didn't complete the course objectives).
Maybe this is interesting:
In Sao Paulo city, because have a lot of people, and so the schools are crowded, there has a law that you can pass grades 1-7 with the worst score. I don't remember when they launched that law (1997 or 98), but I know when you do that, you go to "summer school", and they pass you to the next grade after.
Hi Deguix !
BTW I rewrote and reorganized all my header files using your 'design' (defines-macros-functions), now it's easier with less code and it's working perfectly 👍 !
About the tests:
Ok I understand better now, although I find it strange to have letters AND numbers for the tests marks, especially if the range is just from 0 to 10.. Well, I'm used to have only numbers that's why 😁
So you achieved more than 100 !!! felicitações ! What would that make ? A++ 😛 !?
About San Paulo City (it IS interesting): can't they keep up with the construction of new schools or is it that the city council don't want to ? I mean, the problem has to be serious if they have to make a law: what about the "credibility" of the educational system if anyone can pass 🤪 !?
Anyway have a nice week-end 🙂
evilO/Olive
Maybe in future it can be more than just a header file of string functions...What do you mean ? you intend to make a plugin with these functions ? Don't you think the header file is enough ?
BTW I rewrote and reorganized all my header files using your 'design' (defines-macros-functions), now it's easier with less code and it's working perfectly 👍 !
About the tests:
Ok I understand better now, although I find it strange to have letters AND numbers for the tests marks, especially if the range is just from 0 to 10.. Well, I'm used to have only numbers that's why 😁
So you achieved more than 100 !!! felicitações ! What would that make ? A++ 😛 !?
About San Paulo City (it IS interesting): can't they keep up with the construction of new schools or is it that the city council don't want to ? I mean, the problem has to be serious if they have to make a law: what about the "credibility" of the educational system if anyone can pass 🤪 !?
Anyway have a nice week-end 🙂
evilO/Olive
What do you mean ? you intend to make a plugin with these functions ? Don't you think the header file is enough ?I meant: more header files of other function types...
About the tests:
What would that make ? A++ !?Is the same A+.
About San Paulo City (it IS interesting): can't they keep up with the construction of new schools or is it that the city council don't want to ? I mean, the problem has to be serious if they have to make a law: what about the "credibility" of the educational system if anyone can pass !?When the economy continues not good enough, they cut education, culture... results-> the children learn from parents how to disrespect the other... results-> violence, robbery.... There your home is your prision; who should be in prision is on the streets...
About the credibility, they don't really care, is too difficult to get a new job...
Hello Deguix !
Which functions types would you like to create headers for ? IMHO the string header was the most important. As I told you I have created some with the functions I needed the most, but I doubt many people would need all that stuff.
About the schools:
I didn't understand in the first place that it was an economical reason.. Unfortunately it seems to be the same all over the world:
In France as well, since the elections of 2001 they accelerated the reduction of credits for education, research, culture, health, unemployment benefits, retirement benefits (now we have to work longer to get less money at the end), ... 😠
And the country's money (our money !!) is going to the police, to the army, to taxes exemption for rich people... Just happiness really... 🙄
And in top of that they decided to build 30 new prisons, half of which will be specially 'designed' for youngsters.. They changed the law and now you can go in prison being 16 years old, and 'disciplinary actions' can be taken starting from 13 years old... MAD !! Really I get desperate about mankind..
Well, I think I'll stop complaining for today, and get myself a nice cold beer 🙂
Which functions types would you like to create headers for ? IMHO the string header was the most important. As I told you I have created some with the functions I needed the most, but I doubt many people would need all that stuff.
Is the same A+It was only a (bad) joke 😁
About the schools:
I didn't understand in the first place that it was an economical reason.. Unfortunately it seems to be the same all over the world:
In France as well, since the elections of 2001 they accelerated the reduction of credits for education, research, culture, health, unemployment benefits, retirement benefits (now we have to work longer to get less money at the end), ... 😠
And the country's money (our money !!) is going to the police, to the army, to taxes exemption for rich people... Just happiness really... 🙄
And in top of that they decided to build 30 new prisons, half of which will be specially 'designed' for youngsters.. They changed the law and now you can go in prison being 16 years old, and 'disciplinary actions' can be taken starting from 13 years old... MAD !! Really I get desperate about mankind..
Well, I think I'll stop complaining for today, and get myself a nice cold beer 🙂
Version 1.04:
- Added my new StrCase, removed StrLower and StrUpper.
- Organized by name commands inside header and readme files.
StrCase converts strings to Lower Case and Upper Case + the new Title Case and Sentence Case (readme's example):
(If you noticed, StrCase now appears as the first command due to its name)
The next target for changes probably is "Number to String Converter Function" which has bugs now.
The file:
- Added my new StrCase, removed StrLower and StrUpper.
- Organized by name commands inside header and readme files.
StrCase converts strings to Lower Case and Upper Case + the new Title Case and Sentence Case (readme's example):
- Lower Case (this is just an example. however this can be useful.)Default is "Setence Case". (I didn't include "Invert Case" by NSIS scripting limitations, I have to use System plugin to implement it)
- Upper Case (THIS IS JUST AN EXAMPLE. HOWEVER THIS CAN BE USEFUL.)
- Title Case (This Is Just An Example. However This Can Be Useful.)
- Sentence Case (This is just an example. However this can be useful.)
(If you noticed, StrCase now appears as the first command due to its name)
The next target for changes probably is "Number to String Converter Function" which has bugs now.
The file:
Version 1.05:
- Added new StrNumToStr. Supported languages are English and Portuguese (Brazil).
- Fixed a bug with StrCase, Title Case wasn't working as should be.
- Fixed a bug with StrStrAdv, previous fix created another bug, string not returned correctly when using backwards search with "DisplayStrToSearch" as "0".
New Function StrNumToStr:
Converts Numbers to Strings. Main Features:
- Multilanguage support. (English and Portuguese (Brazil))
- Supports numbers up to 18 digits.
- Virtually, the number digits limit is unlimited (doesn't use Int64), I'm just lazy to add support for numbers bigger than quadrillion...
(as it uses just two languages now, has to be included any of the languages supported by the command in your script)
Anyone can contribute or talk about StrNumToStr translations.
Please test it so I can be certain about its quality.
The file:
- Added new StrNumToStr. Supported languages are English and Portuguese (Brazil).
- Fixed a bug with StrCase, Title Case wasn't working as should be.
- Fixed a bug with StrStrAdv, previous fix created another bug, string not returned correctly when using backwards search with "DisplayStrToSearch" as "0".
New Function StrNumToStr:
Converts Numbers to Strings. Main Features:
- Multilanguage support. (English and Portuguese (Brazil))
- Supports numbers up to 18 digits.
- Virtually, the number digits limit is unlimited (doesn't use Int64), I'm just lazy to add support for numbers bigger than quadrillion...
(as it uses just two languages now, has to be included any of the languages supported by the command in your script)
Anyone can contribute or talk about StrNumToStr translations.
Please test it so I can be certain about its quality.
The file:
Will someone put this version 1.05 inside NSIS package? It has something wrong or is too much updated in a small amount of time?
Testing...
Hi Deguix 🙂
I wanted to do some translations for this new function, and I played a bit with it.. I just have a few questions:
1) For "1789" I have the result "Seventeen hundred and eighty-nine", shouldn't it be "one thousand seven hundred and eighty-nine" ?
I have noticed it as in french it should be "mille sept-cent quatre-vingt-neuf", except if you're talking about a date, in which case both can be used.
For instance:
"la Revolution francaise a eu lieu en dix-sept cent quatre-vingt-neuf"
("The french revolution took place in seventeen hundred and eighty-nine")
2) Another point:
- If I set "100-900_DIFFERENT" to 1, I have:
123123 "Cent vingt-trois mille cent vingt-trois" -> correct
223223 "vingt-trois mille vingt-trois" -> NOT correct, should be "deux cent vingt-trois mille deux cent vingt-trois"
- If I set "100-900_DIFFERENT" to 0, I have:
123123 "un cent vingt-trois mille un cent vingt-trois" -> NOT correct (errors in red)
223223 "Deux cent vingt-trois mille deux cent vingt-trois" -> correct
3) Could you explain these:
11-19_EQUAL
100-900_DIFFERENT
11-99_HUNDRED
Thanks
evilO/Olive
Hi Deguix 🙂
I wanted to do some translations for this new function, and I played a bit with it.. I just have a few questions:
1) For "1789" I have the result "Seventeen hundred and eighty-nine", shouldn't it be "one thousand seven hundred and eighty-nine" ?
I have noticed it as in french it should be "mille sept-cent quatre-vingt-neuf", except if you're talking about a date, in which case both can be used.
For instance:
"la Revolution francaise a eu lieu en dix-sept cent quatre-vingt-neuf"
("The french revolution took place in seventeen hundred and eighty-nine")
2) Another point:
- If I set "100-900_DIFFERENT" to 1, I have:
123123 "Cent vingt-trois mille cent vingt-trois" -> correct
223223 "vingt-trois mille vingt-trois" -> NOT correct, should be "deux cent vingt-trois mille deux cent vingt-trois"
- If I set "100-900_DIFFERENT" to 0, I have:
123123 "un cent vingt-trois mille un cent vingt-trois" -> NOT correct (errors in red)
223223 "Deux cent vingt-trois mille deux cent vingt-trois" -> correct
3) Could you explain these:
11-19_EQUAL
100-900_DIFFERENT
11-99_HUNDRED
Thanks
evilO/Olive
I made some changes to it, added a new LangString for your case, and changed the names of other LangStrings to easier to understand... Test it. Same version. (thanks for trying to translate it, so I can make changes depending how the numbers from other languages are).
1) You can set the translation option "1100-9900_ARE_HUNDRED" to 0, so will output right as you need.
2) I added an option to support this, see the new LangStrings inside StrFunc.nsh.
3) I made changes to make things more clear, see the new LangStrings inside StrFunc.nsh.
1) You can set the translation option "1100-9900_ARE_HUNDRED" to 0, so will output right as you need.
2) I added an option to support this, see the new LangStrings inside StrFunc.nsh.
3) I made changes to make things more clear, see the new LangStrings inside StrFunc.nsh.
Hi Deguix 🙂 !
Ok I tested the modifications:
1) Ok, this works fine now, thanks 👍
2) Still does not work: maybe another flag has to be added for that.
In french, if the figure of the hundreds or the thousands is 1, we do *not* write it. Therefore, 123 should give "cent vingt-trois" and not "un cent vingt-trois"
If this figure is > 1, then we do write it. 223 is written "Deux cent vingt-trois"
Same for the thousands:
1123 should give "Mille cent vingt-trois" and
2123 should give "Deux mille cent vingt-trois"
evilO/Olive
PS: BTW I just had a few compilation problems and had to make changes to
!define FUNCTION_STRING_UninstSupport
...
1) I have replaced:
!define StrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
by:
!define UnStrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
2) Added:
!define UnStrCase `!insertmacro FUNCTION_STRING_StrCase`
and removed:
!define UnStrUpperCase `!insertmacro FUNCTION_STRING_StrUpperCase`
!define UnStrLowerCase `!insertmacro FUNCTION_STRING_StrLowerCase`
I think that's all for now 🙂
Ok I tested the modifications:
1) Ok, this works fine now, thanks 👍
2) Still does not work: maybe another flag has to be added for that.
In french, if the figure of the hundreds or the thousands is 1, we do *not* write it. Therefore, 123 should give "cent vingt-trois" and not "un cent vingt-trois"
If this figure is > 1, then we do write it. 223 is written "Deux cent vingt-trois"
Same for the thousands:
1123 should give "Mille cent vingt-trois" and
2123 should give "Deux mille cent vingt-trois"
evilO/Olive
PS: BTW I just had a few compilation problems and had to make changes to
!define FUNCTION_STRING_UninstSupport
...
1) I have replaced:
!define StrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
by:
!define UnStrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
2) Added:
!define UnStrCase `!insertmacro FUNCTION_STRING_StrCase`
and removed:
!define UnStrUpperCase `!insertmacro FUNCTION_STRING_StrUpperCase`
!define UnStrLowerCase `!insertmacro FUNCTION_STRING_StrLowerCase`
I think that's all for now 🙂
1) Set "1**_DIFFERENT_SUFIX" LangString to 1 and set "100D" as "hundred (in your language)".
"100" and "100D" have to be the same because Portuguese has a little thing different... (100 = "cem", 101 -> 199 = "cento")
2) I fixed these bugs you said now. Test it.
Oh, thanks for the support, I don't know other languages than English and Portuguese (Brazil) so I don't know what to add besides what I did know.
EDIT: Ops! Thousands are different too! I have to work on it later, this file above doesn't have it. (Oh man, Portuguese has it too, how did I forget that!)
"100" and "100D" have to be the same because Portuguese has a little thing different... (100 = "cem", 101 -> 199 = "cento")
2) I fixed these bugs you said now. Test it.
Oh, thanks for the support, I don't know other languages than English and Portuguese (Brazil) so I don't know what to add besides what I did know.
EDIT: Ops! Thousands are different too! I have to work on it later, this file above doesn't have it. (Oh man, Portuguese has it too, how did I forget that!)
Hi Deguix !
Finally, the forums are back 😁 ! Well, anyway we release some software at the moment and I won't be able to test the functions for a few days.. 🙁
Also because writting numbers is more complicated that it looks, at least in french (I had to get a whole web page about writting numbers in french from 1484 to nowadays, with all the variations...).
But don't worry I'll test it ASAP 🙂
Oh, just two little things :
1) In the macro FUNCTION_STRING_UninstSupport, this define is still there:
!define StrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
and should be replaced by
!define UnStrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
2) I've found a (little) bug in the function StrCase :
If you decide to use $R5 to store the function's return value, the return value is appended to the variable's initial value. Just an initialisation problem.
Here is the code to reproduce the bug:
evilO/Olive
Finally, the forums are back 😁 ! Well, anyway we release some software at the moment and I won't be able to test the functions for a few days.. 🙁
Also because writting numbers is more complicated that it looks, at least in french (I had to get a whole web page about writting numbers in french from 1484 to nowadays, with all the variations...).
But don't worry I'll test it ASAP 🙂
Oh, just two little things :
1) In the macro FUNCTION_STRING_UninstSupport, this define is still there:
!define StrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
and should be replaced by
!define UnStrNumToStr `!insertmacro FUNCTION_STRING_StrNumToStr`
2) I've found a (little) bug in the function StrCase :
If you decide to use $R5 to store the function's return value, the return value is appended to the variable's initial value. Just an initialisation problem.
Here is the code to reproduce the bug:
!include StrFunc.nsh
${StrCase}
Name "Example1"
OutFile "example1.exe"
InstallDir $PROGRAMFILES\\Example1
Page instfiles
Section ""
StrCpy $R5 "blabla"
StrCpy $0 "string"
${StrCase} $R5 "$0" "Upper Case"
MessageBox MB_OK "Res: $R5" ; <-- at this point the result is "blablaSTRING"
SectionEnd evilO/Olive
Ahhh... how the old times were good, I had the entire day to test all things I submitted (the computer was too worse you couldn't really play on it). Now with a new computer, the time was shrunken and my brother is liking it because he can now access the internet about everytime, and play his favourite games...
But I'll try to make a file to test this file before launching a new version to test if it works.
Is it really hard to learn how to use French numbers or you're just saying you're not French?
But I'll try to make a file to test this file before launching a new version to test if it works.
Is it really hard to learn how to use French numbers or you're just saying you're not French?
Hi Deguix
Yeah I've seen a few posts about your brother who monopolizes the computer... Erf, the "old times" ... Well, I recall on a 0x86 we could already play at "Double Dragon" or "Xenon 2", but
you're brother probably doesn't know about these 😛
Oh, and I'm french 😁... But there a a different rules, especially for big numbers (what they call "short scale" and "long scale"), some variations. So I would like to take some time to make sure the function behave correctly, and to make proper translations...
Have a nice week-end ! 🙂
evilO/Olive
Yeah I've seen a few posts about your brother who monopolizes the computer... Erf, the "old times" ... Well, I recall on a 0x86 we could already play at "Double Dragon" or "Xenon 2", but
you're brother probably doesn't know about these 😛
Oh, and I'm french 😁... But there a a different rules, especially for big numbers (what they call "short scale" and "long scale"), some variations. So I would like to take some time to make sure the function behave correctly, and to make proper translations...
Have a nice week-end ! 🙂
evilO/Olive
Version 1.06:
- Added instructions for StrNumToStr translation.
- Fixed lots of bugs from faulty basic header file structure relating to StrNumToStr command.
- Fixed the bug where the old string was attached to string returned by StrCase when $R5 variable was used.
I've a new file for testing, which provides all the essential verification system for the header file.
It isn't included with the package because it's just for developer's use now. 🙁
Fixed bugs all bugs, including the ones you said and ones we didn't discover before. Bugs already fixed will never appear anymore.
And I added a new LangString for StrNumToStr, 1***_DIFFERENT_PREFIX which enables thousands to be w/o the number on the left.
Test drive it now!
- Added instructions for StrNumToStr translation.
- Fixed lots of bugs from faulty basic header file structure relating to StrNumToStr command.
- Fixed the bug where the old string was attached to string returned by StrCase when $R5 variable was used.
I've a new file for testing, which provides all the essential verification system for the header file.
It isn't included with the package because it's just for developer's use now. 🙁
Fixed bugs all bugs, including the ones you said and ones we didn't discover before. Bugs already fixed will never appear anymore.
And I added a new LangString for StrNumToStr, 1***_DIFFERENT_PREFIX which enables thousands to be w/o the number on the left.
Test drive it now!
Hi deguix !
Well, I'm really sorry about the delay but as I told you we had
some piece of software to release, deadlines, etc. 🙁
I really had no time, I'm glad it's over for now... 🙂
So I have tested the function, and my conclusion is that it's definitely complicated to create such a function with the support of several languages... 😁
Correct strings are in green, "errors" are in red.
1) About the hundreds and the thousands without the prefix:
It's working perfectly 👍
2) About the numbers from 21 to 69:
The separator changes, it's a special case for 21, 31, 41, 51, 61.
Another flag might have to be added (!!)
- If I set "Sep*0-*9" to " et ", I get this:
20 -> vingt
21 -> vingt et un
22 -> vingt et deux
23 -> vingt et trois
- If I set "Sep*0-*9" to "-", I get this:
20 -> vingt
21 -> vingt-un
22 -> vingt-deux
23 -> vingt-trois
- And it should be:
20 -> vingt
21 -> vingt et un
22 -> vingtt-deux
23 -> vingtt-trois
...
3) About the numbers from 70 to 79:
Instead of having the figure of the tens for "seventy" + 1, 2, 3 ..,
we use the figure of the tens for "sixty": + 11, 12, 13, ...
- I get:
70 -> soixante-dix (60-10)
71 -> soixante-dix et un (60-10 et 1)
72 -> soixante-dix et deux (60-10 et 2)
73 -> soixante-dix et trois (60-10 et 3)
- Instead of:
70 -> soixante-dix (60-10)
71 -> soixante et onze (60 et 11)
72 -> soixante-douze (60-12)
73 -> soixante-treize (60-13)
...
4) Same for the numbers from 90 to 99:
Instead of having the figure of the tens for "ninety" + 1, 2, 3 ..,
we use the figure of the tens for "eighty": + 11, 12, 13, ...
- I get:
90 -> quatre-vingt-dix (4-20-10)
91 -> quatre-vingt-dix et un (4-20-10 et 1)
92 -> quatre-vingt-dix et deux (4-20-10 et 2)
93 -> quatre-vingt-dix et trois (4-20-10 et 3)
...
- Instead of
90 -> quatre-vingt-dix (4-20-10)
91 -> quatre-vingt-onze (4-20-11)
92 -> quatre-vingt-douze (4-20-12)
93 -> quatre-vingt-treize (4-20-13)
...
Now it starts to get complicated...
5) For the numbers from 80 to 89:
5a: Here we use the figure of the tens for "eighty" + 1, 2, 3 ..
5b: it's the same separator for all the numbers
5c: there is a special rule for the plural, as for the hundreds (see point 6)
Therefore we should have:
80 -> quatre-vingts (4-20)
81 -> quatre-vingt-un (4-20-1)
82 -> quatre-vingt-deux (4-20-2)
83 -> quatre-vingt-trois (4-20-3)
...
6) For the hundreds:
The word "cent" (hundred) does vary when there is a digit that multiplies it just before,
and when it's not followed by a cardinal number.
6a: if there are no digits after the hundreds
For instance:
100 -> cent
200 -> deux cents (2 * 100)
300 -> trois cents (3 * 100)
400 -> quatre cents (4 * 100)
...
BUT:
1100 -> mille cent (1000 + 100, does NOT multiply)
6b: if there are digits after the hundreds
201 -> deux cent un
202 -> deux cent deux
203 -> deux cent trois
...
200 000 -> deux cent mille
BUT:
200 000 000 -> deux cents millions
200 000 000 000 -> deux cents milliards
...
As millions, milliards and so on are not "cardinal number" but "names".
Exactly the same rule applies for the word "vingt" in "quatre-vingts".
81 -> quatre-vingt-un
82 -> quatre-vingt-deux
83 -> quatre-vingt-trois
...
80 000 -> quatre-vingt mille
BUT:
80 000 000 -> quatre-vingts millions
80 000 000 000 -> quatre-vingts milliards
Ok I think that's all for now. I just hope that it was clear, don't hesitate to ask if you've got any question.. 🙂
evilO/Olive
Well, I'm really sorry about the delay but as I told you we had
some piece of software to release, deadlines, etc. 🙁
I really had no time, I'm glad it's over for now... 🙂
So I have tested the function, and my conclusion is that it's definitely complicated to create such a function with the support of several languages... 😁
Correct strings are in green, "errors" are in red.
1) About the hundreds and the thousands without the prefix:
It's working perfectly 👍
2) About the numbers from 21 to 69:
The separator changes, it's a special case for 21, 31, 41, 51, 61.
Another flag might have to be added (!!)
- If I set "Sep*0-*9" to " et ", I get this:
20 -> vingt
21 -> vingt et un
22 -> vingt et deux
23 -> vingt et trois
- If I set "Sep*0-*9" to "-", I get this:
20 -> vingt
21 -> vingt-un
22 -> vingt-deux
23 -> vingt-trois
- And it should be:
20 -> vingt
21 -> vingt et un
22 -> vingtt-deux
23 -> vingtt-trois
...
3) About the numbers from 70 to 79:
Instead of having the figure of the tens for "seventy" + 1, 2, 3 ..,
we use the figure of the tens for "sixty": + 11, 12, 13, ...
- I get:
70 -> soixante-dix (60-10)
71 -> soixante-dix et un (60-10 et 1)
72 -> soixante-dix et deux (60-10 et 2)
73 -> soixante-dix et trois (60-10 et 3)
- Instead of:
70 -> soixante-dix (60-10)
71 -> soixante et onze (60 et 11)
72 -> soixante-douze (60-12)
73 -> soixante-treize (60-13)
...
4) Same for the numbers from 90 to 99:
Instead of having the figure of the tens for "ninety" + 1, 2, 3 ..,
we use the figure of the tens for "eighty": + 11, 12, 13, ...
- I get:
90 -> quatre-vingt-dix (4-20-10)
91 -> quatre-vingt-dix et un (4-20-10 et 1)
92 -> quatre-vingt-dix et deux (4-20-10 et 2)
93 -> quatre-vingt-dix et trois (4-20-10 et 3)
...
- Instead of
90 -> quatre-vingt-dix (4-20-10)
91 -> quatre-vingt-onze (4-20-11)
92 -> quatre-vingt-douze (4-20-12)
93 -> quatre-vingt-treize (4-20-13)
...
Now it starts to get complicated...
5) For the numbers from 80 to 89:
5a: Here we use the figure of the tens for "eighty" + 1, 2, 3 ..
5b: it's the same separator for all the numbers
5c: there is a special rule for the plural, as for the hundreds (see point 6)
Therefore we should have:
80 -> quatre-vingts (4-20)
81 -> quatre-vingt-un (4-20-1)
82 -> quatre-vingt-deux (4-20-2)
83 -> quatre-vingt-trois (4-20-3)
...
6) For the hundreds:
The word "cent" (hundred) does vary when there is a digit that multiplies it just before,
and when it's not followed by a cardinal number.
6a: if there are no digits after the hundreds
For instance:
100 -> cent
200 -> deux cents (2 * 100)
300 -> trois cents (3 * 100)
400 -> quatre cents (4 * 100)
...
BUT:
1100 -> mille cent (1000 + 100, does NOT multiply)
6b: if there are digits after the hundreds
201 -> deux cent un
202 -> deux cent deux
203 -> deux cent trois
...
200 000 -> deux cent mille
BUT:
200 000 000 -> deux cents millions
200 000 000 000 -> deux cents milliards
...
As millions, milliards and so on are not "cardinal number" but "names".
Exactly the same rule applies for the word "vingt" in "quatre-vingts".
81 -> quatre-vingt-un
82 -> quatre-vingt-deux
83 -> quatre-vingt-trois
...
80 000 -> quatre-vingt mille
BUT:
80 000 000 -> quatre-vingts millions
80 000 000 000 -> quatre-vingts milliards
Ok I think that's all for now. I just hope that it was clear, don't hesitate to ask if you've got any question.. 🙂
evilO/Olive
What is that? Oh man, this will be more complicated than I ever imagined... OK, it won't be done so fast...
How about a version without that function for now?
As you wish, removed all info about this function for now, until I get it done (won't be so soon 🙁):
Hi Deguix !
I'm sorry to have discouraged you, I just wanted to help... 🙁
But, as I told you in a previous post, it's quite complicated to write
numbers in french (I think you have noticed 😁).
And I tried to make it as simple and structured as possible...
Well, it's not an easy job, I understand you don't want to program that now.
Just let me know when something is done if you want me to do some tests.. 🙂
evilO/Olive
I'm sorry to have discouraged you, I just wanted to help... 🙁
But, as I told you in a previous post, it's quite complicated to write
numbers in french (I think you have noticed 😁).
And I tried to make it as simple and structured as possible...
Well, it's not an easy job, I understand you don't want to program that now.
Just let me know when something is done if you want me to do some tests.. 🙂
evilO/Olive
I don't want to do that now because I working on several projects for some other programs. Just to prevent "overload". 😁 But when everything is clear I'll work again on it.
I just uploaded the new version of StrFunc.nsh test. Is to replace the older one (which doesn't compile now). It tests all commands when installing and uninstalling.
So which one is it going to be for 2.01?
1) The last zip file.
2) This last file which is the test of StrFunc (as you or Joost requested in PM, replacing the example coming with NSIS which has problems).
3) The updated documentation below. I fixed only the mention of StrNumToStr on the Comments about functions included and not included, Version History and Functions Credits. Same version.
2) This last file which is the test of StrFunc (as you or Joost requested in PM, replacing the example coming with NSIS which has problems).
3) The updated documentation below. I fixed only the mention of StrNumToStr on the Comments about functions included and not included, Version History and Functions Credits. Same version.
String Functions Header File 1.07
As kichik slowed so much the release of NSIS 2.01 (see previous posts) I could have some time off to do the new String Functions Header File. Give a look on these changes below:
1.07 - 09/16/2004
- StrStrAdv and StrCase have their functions remodeled with LogicLib.
Functions have a lesser chance to have bugs.
- Added case-sensitive comparation option for StrStrAdv.
- StrCase now uses System.dll which makes case convertions effective with
all latin letters (i.e. ê).
- StrClbSet and StrClbGet removed, added StrClb.
- Made compact the most usual operations inside the header file. File size
reduced.
- Added "!verbose" to header file -> faster compilation and header file
output organized (code borrowed from LogicLib.nsh).
Kichik, as you plan to release NSIS 2.01 (for real this time) you can put the StrFunc test example on NSIS for now (just to update). Then afterwards, I'll create a better example like the one from Word Functions Header File (but better, hehe 🙂 what am I planning now?)
Thank you dselkirk and eccles for LogicLib. That tool made everything easier for me this version...
This file below contains:
- StrFunc.nsh (header)
- StrFunc.txt (manual)
- StrFunc.nsi (example)
As kichik slowed so much the release of NSIS 2.01 (see previous posts) I could have some time off to do the new String Functions Header File. Give a look on these changes below:
1.07 - 09/16/2004
- StrStrAdv and StrCase have their functions remodeled with LogicLib.
Functions have a lesser chance to have bugs.
- Added case-sensitive comparation option for StrStrAdv.
- StrCase now uses System.dll which makes case convertions effective with
all latin letters (i.e. ê).
- StrClbSet and StrClbGet removed, added StrClb.
- Made compact the most usual operations inside the header file. File size
reduced.
- Added "!verbose" to header file -> faster compilation and header file
output organized (code borrowed from LogicLib.nsh).
Kichik, as you plan to release NSIS 2.01 (for real this time) you can put the StrFunc test example on NSIS for now (just to update). Then afterwards, I'll create a better example like the one from Word Functions Header File (but better, hehe 🙂 what am I planning now?)
Thank you dselkirk and eccles for LogicLib. That tool made everything easier for me this version...
This file below contains:
- StrFunc.nsh (header)
- StrFunc.txt (manual)
- StrFunc.nsi (example)
- The example fails on StrClb
- If you're already using System.dll, why not use IsCharAlpha or even GetStringType instead of lots of comprasions?
- You don't have to make two copies of the code, you can assume the LogicLib is present. It is installed a line after StrFunc.nsh in makensis.nsi
Updated documentation because I forgot to remove a feature from ${StrCase}. (not again)🙁
The example fails on StrClbThis was not expected by me, where did you find the failure?
If you're already using System.dll, why not use IsCharAlpha or even GetStringType instead of lots of comprasions?Maybe you should give me "IsCharAlpha" code, because I couldn't get it to work at any costs.
You don't have to make two copies of the code, you can assume the LogicLib is present. It is installed a line after StrFunc.nsh in makensis.nsiThe real thing is that the LogicLib version is (probably) the same as the converted to normal one. Commenting one of them makes no difference. If you want me to do so I can comment the LogicLib one and just include the original in the distribution.
The failure is in Examples\StrFunc.nsi.
IsCharAlpha needs a char. For this, you can treat the string a struct of some bytes and get the first byte.
If I were you, I'd prefer keeping the LogicLib code. It's simpler. Why keep two versions? It's more work.
IsCharAlpha needs a char. For this, you can treat the string a struct of some bytes and get the first byte.
If I were you, I'd prefer keeping the LogicLib code. It's simpler. Why keep two versions? It's more work.