PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → New Capitalize
New Capitalize
Débuté par BOLLER, 17 oct. 2019 21:38 - 7 réponses
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 17 octobre 2019 - 21:38
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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:45
// 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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:46
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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:46
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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:47
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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:47
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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:47
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/
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 30 novembre 2023 - 01:48
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/