PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 25 → New Capitalize
New Capitalize
Started by BOLLER, Oct., 17 2019 9:38 PM - 7 replies
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on October, 17 2019 - 9:38 PM
Procedure New_Capitalize(Texto)

x is int = 0

Nome, newNome is string =""

IF Texto <> "" THEN

nQtdeEspaco is int = StringCount(Texto," ")

LOOP(nQtdeEspaco)
x++
Nome = ExtractString(Texto,x," ",FromBeginning)
Nome = Upper(Middle(Nome,1,1)) + Middle(Nome,2,Length(Nome)) + " "
newNome += Nome
END

newNome = Replace(newNome," Da ", " da ")

newNome = Replace(newNome," Das ", " das ")

newNome = Replace(newNome," De ", " de ")

newNome = Replace(newNome," Do ", " do ")

newNome = Replace(newNome," Dos ", " dos ")

END

RESULT newNome


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:45 AM
// Summary: <specify the procedure action>
// Syntax:
//Capitalize (<Texto>)
//
// Parameters:
// Texto: <specify the role of Texto>
// Example:
// <Specify a usage example>
//
// Return value:
Procedure Capitalize(NomeTexto)

x is int = 0

Nome,newNome is string = ""

NomeTexto=NomeTexto+" "

IF NomeTexto <>""

nQtdeEspaco is int = StringCount(NomeTexto," ")

LOOP(nQtdeEspaco)
x++
Nome = NomeTexto
Nome = ExtractString(Nome,x," ",FromBeginning)
Nome = Upper(Middle(Nome,1,1)) + Lower(Middle(Nome,2,Length(Nome))) +" "
newNome += Nome
END

newNome = Replace(newNome," As "," as ")

newNome = Replace(newNome," Da "," da ")

newNome = Replace(newNome," Das "," das ")

newNome = Replace(newNome," De "," de ")

newNome = Replace(newNome," Do "," do ")

newNome = Replace(newNome," Dos "," dos ")

END

RESULT newNome


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:46 AM
Procedure evento_objetos_UpperCapitalizado(objetos is array of string)

i is int = 0

LOOP( ArrayCount( objetos ))

i++

indirection is string = objetos[i]

{indirection} = Capitalize( {indirection} )

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:46 AM
Procedure evento_objetos_upper(objetos is array of string)

i is int = 0

LOOP( ArrayCount( objetos ))

i++

indirection is string = objetos[i]

{indirection} = Upper( {indirection} )

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:47 AM
Procedure evento_objetos_lower(objetos is array of string)

i is int = 0

LOOP( ArrayCount( objetos ))

i++

indirection is string = objetos[i]

{indirection} = Lower( {indirection} )

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:47 AM
Procedure evento_objetos_noaccent(objetos is array of string)

i is int = 0

LOOP( ArrayCount( objetos ))

i++

indirection is string = objetos[i]

{indirection} = NoAccent( {indirection} )

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:47 AM
Procedure evento_objetos_nospace(objetos is array of string)

i is int = 0

LOOP( ArrayCount( objetos ))

i++

indirection is string = objetos[i]

{indirection} = NoSpace( {indirection} , sscLeft) //no space a esquerda

{indirection} = NoSpace( {indirection} , sscRight) //no space a direita

{indirection} = Replace( {indirection}, " "," ") // 2 para 1

{indirection} = Replace( {indirection}, " "," ") // 3 para 1

END


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Registered member
3,657 messages
Popularité : +175 (223 votes)
Posted on November, 30 2023 - 1:48 AM
Procedure evento_lista_objetos(gs_nomeJanela)

i,j is int = 0
sBusca is string = ""
sControlName is string = ""
arrayControles is array of string

LOOP(5000)

i++

sControlName = gpwEnumControl(gs_nomeJanela, i)

IF Length(sControlName) > 0 THEN

sBusca = NoSpace(gs_nomeJanela)+"."+NoSpace(ExtractString(sControlName,1,TAB,FromBeginning))

IF Length(sBusca) > (Length(gs_nomeJanela) + 1)

Add(arrayControles,sBusca)
//Trace(sBusca)

ELSE
BREAK
END

ELSE
BREAK
END

END

ArrayDelete(arrayControles,ArrayCount(arrayControles))

RESULT arrayControles


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/