vbProperCase problem
Hi Friends
Look at the following code
Can anybody explain it to me why??????????
Look at the following code
|
|
Jabaco Source |
1 2 3 4 5 |
Public Sub Command1_Click() msgbox(StrConv(Text1.Text, vbUpperCase)) ' works fine msgbox(StrConv(Text1.Text, vbLowerCase)) 'works fine msgbox(StrConv(Text1.Text, vbProperCase)) 'does not work ????????????? End Sub |
Can anybody explain it to me why??????????
If you look this up in the Framework, you find in Strings.java:
So, this feature needs a volunteer to implement it.
Greetings
A1880
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
private static String PCase(String String1) { return (String1); } private static String XCase(String String1) { return (String1); } public static String StrConv(String String1, VBStrConv ConvMet) { switch ( ConvMet.intValue() ) { case ( 1 ): { return (UCase(String1)); } // vbUpperCase case ( 2 ): { return (LCase(String1)); } // vbLowerCase case ( 3 ): { return (PCase(String1)); } // vbProperCase // NOT IMPLEMENTED case ( 4 ): { return (XCase(String1)); } // vbWide // NOT IMPLEMENTED case ( 8 ): { return (XCase(String1)); } // vbNarrow // NOT IMPLEMENTED case ( 16 ): { return (XCase(String1)); } // vbKatakana // NOT IMPLEMENTED case ( 32 ): { return (XCase(String1)); } // vbHiragana // NOT IMPLEMENTED case ( 64 ): { return (XCase(String1)); } // vbUnicode // NOT IMPLEMENTED case ( 128 ): { return (XCase(String1)); } // vbFromUnicode // NOT IMPLEMENTED } return (String1); } |
So, this feature needs a volunteer to implement it.
Greetings
A1880
So, this feature needs a volunteer to implement it.
Done.
Current implementation is
|
|
Jabaco Source |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
public static String PCase(String String1) { String String2 = ""; boolean lastWasLetter = false; for (int i=0; i<=String1.length()-1; i++) { Character ch = String1.charAt(i); if (Character.isLetterOrDigit(ch)) { if (Character.isDigit(ch)) { String2 = String2.concat(ch.toString()); } else if (lastWasLetter) { String2 = String2.concat(ch.toString().toLowerCase()); lastWasLetter = true; } else { String2 = String2.concat(ch.toString().toUpperCase()); lastWasLetter = true; } } else { String2 = String2.concat(ch.toString()); lastWasLetter = false; } } return (String2); } |
The last change was, that I made it to public, so that it is possible to use it direct as PCase(String) like it is possible with UCase and LCase.
If you think it would be better to call it only over StrConv, then I will change it back to private.
Greatings
theuserbl
How can we get the updated framework for download?
From
http://www.file-upload.net/download-3086647/Jabaco.jar.html
But it is only a minor change. Only the Systems-class was chenged.
And there is a little problem. Currently I have compiled Systems.java with the options "-source 1.5 -target 1.5", because with "-source 1.4 -target 1.4.2" there comes for Systems.java the following errors:
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
VBA\Strings.java:205: incompatible types
found : char
required: java.lang.Character
Character ch = String1.charAt(i);
^
VBA\Strings.java:206: cannot find symbol
symbol : method isLetterOrDigit(java.lang.Character)
location: class java.lang.Character
if (Character.isLetterOrDigit(ch)) {
^
VBA\Strings.java:207: cannot find symbol
symbol : method isDigit(java.lang.Character)
location: class java.lang.Character
if (Character.isDigit(ch)) {
^
3 errors
|
So sadly with my last code, it is no longer 1.4-compatible.
I will look at a solution.
Ok, here is now the actual version:
http://www.file-upload.net/download-3086723/Jabaco.jar.html
And it is again compiled with the Java 1.4 options.
Here the little changes, to make it work with 1.4:
http://code.google.com/p/jabacoframework/source/detail?r=80#
http://www.file-upload.net/download-3086723/Jabaco.jar.html
And it is again compiled with the Java 1.4 options.
Here the little changes, to make it work with 1.4:
http://code.google.com/p/jabacoframework/source/detail?r=80#
Similar threads
-
General topics, questions and discussions »-
Error starting application
(Jul 1st 2009, 8:42pm)
-
Tips, Tricks, Samples & Tutorials »-
EXE won't run
(Apr 23rd 2010, 12:21pm)
-
Bugreports and known bugs »-
[VERSION 1.5.2] Startup problem
(Jan 26th 2010, 11:42am)
-
Bugreports and known bugs »-
[VERSION 1.5.2] Run Error Ver. 1.4.2-1.5.2
(Sep 12th 2009, 1:18am)
-
General topics, questions and discussions »-
Launching Jabaco
(Aug 21st 2009, 8:19pm)
