Source language: Translate to:

Upper, Lower, Proper

General questions about NeoBook

Moderator: Neosoft Support

Upper, Lower, Proper

Postby StarterPack » Tue Feb 21, 2017 1:05 am

Hi guys

I know about the StrUpper and StrLower. I need the "Proper" function. Is it possible?
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Upper, Lower, Proper

Postby Gaev » Tue Feb 21, 2017 6:28 am

StarterPack:

1) http://neosoftwarecom.ipower.com/neoboo ... =9&lid=282 - does Title Case - check NeoBook Resource Center ... there might be other plugins that provides such tranformations.

2) you can build a generic routine (GoSub or Call) that ...

- accepts a sentence text e.g. [MySentence]

- uses StrParse to split it into words

- then loops through each array item ...
-- uses SubStr to extract the first character
-- uses StrUpper to convert it
-- uses [b]StrReplace[b] to replace the first character
-- adds the Titled word and a space to something like [TitledSentence]
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Upper, Lower, Proper

Postby virger » Tue Feb 21, 2017 7:45 am

Yo uso esta funcion
I use this function
La Funcion/The Function
Code: Select all
{NeoBook Function}
Version=5,80
Language=JScript
Param=[%str]|Variable|Texto A 'Capitalizar'
{End}
var str = nbGetVar("[%str]");
nbSetVar("[%str]",str.replace(/(\b\w)/gi,function(m){return m.toUpperCase();}));


Boton de Ejemplo/The Button Sample
Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=3
Name=PushButton4
X=253
Y=135
W=248
H=50
Anchor=0
Text=Capitalice¶[tx]
Align=1
ImageStyle=0
XPTheme=Yes
ObjAction=setvar "[Tx]" "hola gdo san como estas?"¶Call "MiCapi" "[tx]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=6


Enjoy
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Upper, Lower, Proper

Postby StarterPack » Wed Feb 22, 2017 2:42 am

Thank you guys for the reply

What I did was...

StrReplace "[Name]" "[Name]" " [Name]" "[Name]"
StrReplace "[Name]" " a" "A" "[Name]" ""
StrReplace "[Name]" " b" "B" "[Name]" ""
StrReplace "[Name]" " c" "C" "[Name]" ""
till
StrReplace "[Name]" " z" "Z" "[Name]" ""
StrDel "[Name]" "1" "1" "[Name]"

This works for me just fine

... but this is only if you want to use it in 1 line like TextEntry
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Upper, Lower, Proper

Postby virger » Wed Feb 22, 2017 5:54 am

?????????????????
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central


Return to General NeoBook Discussions

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests