domingo, 31 de janeiro de 2021

FMX - excluindo os não múltiplos de um numero

 



No post anterior criamos um programa, que apagava
todas as ocorrências dos múltiplos de um número,
neste aqui faremos ao contrário,
apagaremos todos os não múltiplos de um número
dentro de uma matriz de inteiros de dez mil elementos.
acompanhem no vídeo  seu funcionamento por favor:



//---------------------------------------------------------------------------

#include <fmx.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
int n;
int A [ 100 ] [ 100 ];
int t, x;
    TText *Text1;
TText *Text4;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Informe ( TObject *Sender ) {
TText *Text1;
Text1  = new TText ( this );
Text1 -> Parent = Form1;
Text1 -> AutoSize = True;
Text1 -> TextSettings -> Font -> Family = "Consolas";
Text1 -> TextSettings -> Font -> Size = 14;
Text1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
//Text1-> Color = clYellow;
Text1-> TextSettings -> FontColor = claRed;
Text1 -> Width = 200;
Text1 -> Height = 50;
Text1 -> Position -> Y = 330;
Text1 -> Position -> X = 250;
Text1 -> Text = "Por: ";

TText *Text2;
Text2  = new TText ( this );
Text2 -> Parent = Form1;
Text2 -> AutoSize = True;
Text2 -> TextSettings -> Font -> Family = "Consolas";
Text2 -> TextSettings -> Font -> Size = 14;
Text2 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
//Text2-> Color = clYellow;
Text2-> TextSettings -> FontColor = claBlue;
Text2 -> Width = 200;
Text2 -> Height = 50;
Text2 -> Position -> Y = 330;
Text2 -> Position -> X = 295;
Text2 -> Text = "Samuel Lima";

TText *Text3;
Text3  = new TText ( this );
Text3 -> Parent = Form1;
Text3 -> AutoSize = True;
Text3 -> TextSettings -> Font -> Family = "Consolas";
Text3 -> TextSettings -> Font -> Size = 14;
Text3 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
//Text3-> Color = clYellow;
Text3 -> TextSettings -> FontColor = claBlack;
Text3 -> Width = 200;
Text3 -> Height = 50;
Text3 -> Position -> Y = 342;
Text3 -> Position -> X = 250;
Text3 -> Text = "sa_sp10@hotmail.com";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Label_Manual ( TObject *Sender ) {
Rectangle1 -> Width = 640;
Rectangle1 -> Height = 370;
Rectangle1 -> Position -> X = 0;
Rectangle1 -> Position -> Y = 0;
//Rectangle1 -> Fill -> Color = claWhite;
Rectangle1 -> Size -> PlatformDefault = False;
Rectangle1 -> Stroke -> Color = claRed;
Rectangle1 -> Stroke -> Thickness = 10;
Rectangle1 -> XRadius = 15;
Rectangle1 -> YRadius = 15;

Label1 -> Position -> X = 100;
Label1 -> Position -> Y = 10;
Label1 -> Size -> Width = 580;
Label1 -> Size -> Height = 19;
Label1 -> TextSettings -> Font -> Size = 18;
Label1 -> TextSettings -> FontColor = claRed;
Label1 -> TextSettings -> Font -> Family = "Consolas";
Label1 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
Label1 -> Text = "FMX - APAGANDO OS NÃO MÚLTIPLOS DE UM NÚMERO";


   Text1 -> TextSettings -> Font -> Family = "Alarm clock";
   Text1 -> TextSettings -> Font -> Size = 14;
   Text1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold;
   Text1-> TextSettings -> FontColor = claBlack;
   Text1 -> Position -> X = 20;
   Text1 -> Position -> Y = -40;
   Text1 -> AutoSize = True;
   //Text1 -> Size -> Height = 9000;
   Text1 -> Size -> Width = 540;

Text4  = new TText ( this );
Text4 -> Parent = Form1;
Text4 -> TextSettings -> Font -> Size = 14;
Text4 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold;
Text4-> TextSettings -> FontColor = claBlue;
Text4 -> Position -> X = 0;
Text4 -> Position -> Y = 310;
Text4 -> Size -> Width = 700;
Text4 -> Size -> Height = 20;

   Edit1 -> SetFocus ( );
   Edit1 -> Font -> Size = 13;
   //Edit1 -> TextSettings -> Font -> Family = "Alarm clock";
   Edit1 -> Size -> PlatformDefault = False;
   Edit1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold;
   Edit1 -> TextSettings -> FontColor = claRed;
   Edit1 -> Width = 90;
   Edit1 -> Height = 20;
   Edit1 -> Position -> X = 60;
   Edit1 -> Position -> Y = 330;

Button1 -> Visible = true;
Button1 -> Width = 30;
Button1 -> Height = 20;
Button1 -> Position -> X = 160;
Button1 -> Position -> Y = 330;
Button1 -> TextSettings -> Font -> Family = "Arial";
Button1 -> TextSettings -> Font -> Size = 16;
Button1 -> TextSettings -> FontColor = claBlue;
Button1 -> Text = "Ok";

ScrollBox1 -> Width = 600;
ScrollBox1 -> Height = 270;
ScrollBox1 -> Position -> X = 20;
ScrollBox1 -> Position -> Y = 40;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Imprime_matriz ( TObject* Sender ) {
   AnsiString str_1 = " ";
   int a, b, i;
  for( i = 0; i < 10000; i++ ) {
A [ b ] [ a ] =  i;
a++;
}
for ( a = 0; a < 100; a++ ) {
for ( b = 0; b < 100; b++ ) {
AppendStr ( str_1, "\t" );
if ( A [ a ] [ b ] % 10 == 0 ) {
AppendStr ( str_1, "\n" );
}
if ( A [ a ] [ b ] >= 0 && A [ a ] [ b ] < 10 ) {
AppendStr ( str_1, "000" );
}
if ( A [ a ] [ b ] >= 10 && A [ a ] [ b ] < 100 ) {
AppendStr ( str_1, "00" );
}
if ( A [ a ] [ b ] >= 100 && A [ a ] [ b ] < 1000 ) {
AppendStr ( str_1, "0" );
}
   AppendStr ( str_1, A [ a ] [ b ] );
}
}
Text1 -> Text = str_1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click ( TObject *Sender ) {
int a, b;
String str_4;
Text1 -> Text = "";
n = StrToInt ( Edit1 -> Text );
AnsiString str_1 = " ";

for ( a = 0; a < 100; a++ ) {
for ( b = 0; b < 100; b++ ) {
AppendStr ( str_1, "\t" );
if ( A [ a ] [ b ] % 10 == 0 ) {
AppendStr ( str_1, "\n" );
}
//==================================================================
if ( A [ a ] [ b ] % n == 0 ) {
   t++;
   str_4 = t - 1;
if ( A [ a ] [ b ] >= 0 && A [ a ] [ b ] < 10 ) {
AppendStr ( str_1, "000" );
}
if ( A [ a ] [ b ] >= 10 && A [ a ] [ b ] < 100 ) {
AppendStr ( str_1, "00" );
}
if ( A [ a ] [ b ] >= 100 && A [ a ] [ b ] < 1000 ) {
AppendStr ( str_1, "0" );
}
str_1 += A [ a ] [ b ];
            Rectangle1 -> Stroke -> Color = claGreen;
   }
   //==================================================================
}
}
Text1 -> Text = str_1;

Text4 -> Text = " ";
Text4 -> Text = Text4 -> Text + "Apagado ";
Text4 -> Text = Text4 -> Text + str_4;
Text4 -> Text = Text4 -> Text + " não múltiplos de ";
Text4 -> Text = Text4 -> Text + n;
Edit1 -> Text = "";
Edit1 -> SetFocus ( );
t = 0;
Informe ( Sender );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender){
Label_Manual ( Sender );
Imprime_matriz ( Sender );
}
//---------------------------------------------------------------------------

sábado, 30 de janeiro de 2021

FMX - excluindo multiplos entre 0 e 10000


A alguns meses passados construímos um programa,
que marcava as ocorrências dos múltiplos de um número,
em uma cor diferente dos não múltiplos dentro de uma
matriz de inteiros de dez mil elementos,
agora fizemos diferente, estamos pesquisando
os múltiplos de um determinado número e apagando
todas as suas ocorrências dentro da matriz,
acompanhem no vídeo por favor:





//---------------------------------------------------------------------------

#include <fmx.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
int n;
int A [ 100 ] [ 100 ];
int t, x;
    TText *Text1;
TText *Text4;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Informe ( TObject *Sender ) {
TText *Text1;
Text1  = new TText ( this );
Text1 -> Parent = Form1;
Text1 -> AutoSize = True;
Text1 -> TextSettings -> Font -> Family = "Consolas";
Text1 -> TextSettings -> Font -> Size = 14;
Text1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
//Text1-> Color = clYellow;
Text1-> TextSettings -> FontColor = claRed;
Text1 -> Width = 200;
Text1 -> Height = 50;
Text1 -> Position -> Y = 330;
Text1 -> Position -> X = 250;
Text1 -> Text = "Por: ";

TText *Text2;
Text2  = new TText ( this );
Text2 -> Parent = Form1;
Text2 -> AutoSize = True;
Text2 -> TextSettings -> Font -> Family = "Consolas";
Text2 -> TextSettings -> Font -> Size = 14;
Text2 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
//Text2-> Color = clYellow;
Text2-> TextSettings -> FontColor = claBlue;
Text2 -> Width = 200;
Text2 -> Height = 50;
Text2 -> Position -> Y = 330;
Text2 -> Position -> X = 295;
Text2 -> Text = "Samuel Lima";

TText *Text3;
Text3  = new TText ( this );
Text3 -> Parent = Form1;
Text3 -> AutoSize = True;
Text3 -> TextSettings -> Font -> Family = "Consolas";
Text3 -> TextSettings -> Font -> Size = 14;
Text3 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
//Text3-> Color = clYellow;
Text3 -> TextSettings -> FontColor = claBlack;
Text3 -> Width = 200;
Text3 -> Height = 50;
Text3 -> Position -> Y = 342;
Text3 -> Position -> X = 250;
Text3 -> Text = "sa_sp10@hotmail.com";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Label_Manual ( TObject *Sender ) {
Rectangle1 -> Width = 640;
Rectangle1 -> Height = 370;
Rectangle1 -> Position -> X = 0;
Rectangle1 -> Position -> Y = 0;
//Rectangle1 -> Fill -> Color = claWhite;
Rectangle1 -> Size -> PlatformDefault = False;
Rectangle1 -> Stroke -> Color = claBlue;
Rectangle1 -> Stroke -> Thickness = 10;
Rectangle1 -> XRadius = 15;
Rectangle1 -> YRadius = 15;

Label1 -> Position -> X = 130;
Label1 -> Position -> Y = 10;
Label1 -> Size -> Width = 580;
Label1 -> Size -> Height = 19;
Label1 -> TextSettings -> Font -> Size = 18;
Label1 -> TextSettings -> FontColor = claRed;
Label1 -> TextSettings -> Font -> Family = "Consolas";
Label1 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
Label1 -> Text = "FMX - PESQUISANDO MÚLTIPLOS E APAGANDO";


   Text1 -> TextSettings -> Font -> Family = "Alarm clock";
   Text1 -> TextSettings -> Font -> Size = 14;
   Text1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold;
   Text1-> TextSettings -> FontColor = claBlack;
   Text1 -> Position -> X = 20;
   Text1 -> Position -> Y = -40;
   Text1 -> AutoSize = True;
   //Text1 -> Size -> Height = 9000;
   Text1 -> Size -> Width = 540;

Text4  = new TText ( this );
Text4 -> Parent = Form1;
Text4 -> TextSettings -> Font -> Size = 14;
Text4 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold;
Text4-> TextSettings -> FontColor = claBlue;
Text4 -> Position -> X = 0;
Text4 -> Position -> Y = 310;
Text4 -> Size -> Width = 700;
Text4 -> Size -> Height = 20;

   Edit1 -> SetFocus ( );
   Edit1 -> Font -> Size = 13;
   //Edit1 -> TextSettings -> Font -> Family = "Alarm clock";
   Edit1 -> Size -> PlatformDefault = False;
   Edit1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold;
   Edit1 -> TextSettings -> FontColor = claRed;
   Edit1 -> Width = 90;
   Edit1 -> Height = 20;
   Edit1 -> Position -> X = 60;
   Edit1 -> Position -> Y = 330;

Button1 -> Visible = true;
Button1 -> Width = 30;
Button1 -> Height = 20;
Button1 -> Position -> X = 160;
Button1 -> Position -> Y = 330;
Button1 -> TextSettings -> Font -> Family = "Arial";
Button1 -> TextSettings -> Font -> Size = 16;
Button1 -> TextSettings -> FontColor = claBlue;
Button1 -> Text = "Ok";

ScrollBox1 -> Width = 600;
ScrollBox1 -> Height = 270;
ScrollBox1 -> Position -> X = 20;
ScrollBox1 -> Position -> Y = 40;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Imprime_matriz ( TObject* Sender ) {
   AnsiString str_1 = " ";
   int a, b, i;
  for( i = 0; i < 10000; i++ ) {
A [ b ] [ a ] =  i;
a++;
}
for ( a = 0; a < 100; a++ ) {
for ( b = 0; b < 100; b++ ) {
AppendStr ( str_1, "\t" );
if ( A [ a ] [ b ] % 10 == 0 ) {
AppendStr ( str_1, "\n" );
}
if ( A [ a ] [ b ] >= 0 && A [ a ] [ b ] < 10 ) {
AppendStr ( str_1, "000" );
}
if ( A [ a ] [ b ] >= 10 && A [ a ] [ b ] < 100 ) {
AppendStr ( str_1, "00" );
}
if ( A [ a ] [ b ] >= 100 && A [ a ] [ b ] < 1000 ) {
AppendStr ( str_1, "0" );
}
   AppendStr ( str_1, A [ a ] [ b ] );
}
}
Text1 -> Text = str_1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click ( TObject *Sender ) {
int a, b;
String str_4;
Text1 -> Text = "";
n = StrToInt ( Edit1 -> Text );
AnsiString str_1 = " ";

for ( a = 0; a < 100; a++ ) {
for ( b = 0; b < 100; b++ ) {
AppendStr ( str_1, "\t" );
if ( A [ a ] [ b ] % 10 == 0 ) {
AppendStr ( str_1, "\n" );
}
//==================================================================
if ( A [ a ] [ b ] % n == 0 ) {
   t++;
   str_4 = t - 1;
   }
   else {
if ( A [ a ] [ b ] >= 0 && A [ a ] [ b ] < 10 ) {
AppendStr ( str_1, "000" );
}
if ( A [ a ] [ b ] >= 10 && A [ a ] [ b ] < 100 ) {
AppendStr ( str_1, "00" );
}
if ( A [ a ] [ b ] >= 100 && A [ a ] [ b ] < 1000 ) {
AppendStr ( str_1, "0" );
}
str_1 += A [ a ] [ b ];
   }
   //==================================================================
}
}
Text1 -> Text = str_1;

Text4 -> Text = " ";
Text4 -> Text = Text4 -> Text + "Apagado ";
Text4 -> Text = Text4 -> Text + str_4;
Text4 -> Text = Text4 -> Text + " múltiplos de ";
Text4 -> Text = Text4 -> Text + n;
Edit1 -> Text = "";
Edit1 -> SetFocus ( );
t = 0;
Informe ( Sender );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender){
Label_Manual ( Sender );
Imprime_matriz ( Sender );
}
//---------------------------------------------------------------------------




quarta-feira, 27 de janeiro de 2021

C++ builder - colorindo vogais


Declaramos e inicializamos uma matriz
bidimensional de string do C,
e imprimimos usando um Label do C++ builder.
Até aqui nenhuma novidade,
mas nossa ideia era de fazer pesquisas de caracteres
dentro desta matriz, e fizemos isto perfeitamente,
utilizando trechos de códigos que já utilizo
a muito tempo, desde os tempos da velha janelinha preta,
mas a graça do programa seria colorir todas as vogais
encontradas na matriz com cores distintas.
Deu tudo certo, tenho certeza que muitos vão querer
testar isto, ou pelo menos querer saber como tudo foi feito.



//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#define lin  12
#define col 45
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
String str;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void Informe ( ) {
Form1 -> Canvas -> Font -> Size = 12;
Form1 -> Canvas -> Font -> Name = "Garamond";
Form1 -> Canvas -> Font -> Color = clBlack;
Form1 -> Canvas -> TextOut ( 270, 290, "Por: " );
Form1 -> Canvas -> Font -> Color = clRed;
Form1 -> Canvas -> TextOut ( 310, 290, "Samuel Lima" );
Form1 -> Canvas -> Font -> Color = clBlack;
Form1 -> Canvas -> TextOut ( 270, 305, "sa_sp10@hotmail.com" );
Form1 -> Canvas -> Font -> Name = "Garamond";
}
//---------------------------------------------------------------------------
     char texto [ lin ] [ col ] = {
        "No Meio do Caminho                         ",
        "Carlos Drummond de Andrade                 ",
        "No meio do caminho tinha uma pedra         ",
        "Tinha uma pedra no meio do caminho         ",
        "Tinha uma pedra                            ",
        "No meio do caminho tinha uma pedra.        ",
        "Nunca me esquecerei desse acontecimento    ",
        "Na vida de minhas retinas tao fatigadas.   ",
        "Nunca me esquecerei que no meio do caminho ",
        "Tinha uma pedra                            ",
        "Tinha uma pedra no meio do caminho         ",
"No meio do caminho tinha uma pedra.        "};
// ---------------------------------------------------------------------------
void __fastcall TForm1::Label_Manual ( TObject* Sender ) {
Edit1 -> SetFocus ( );
    Edit1 -> Font -> Size = 12;
    Edit1 -> Width = 90;
    Edit1 -> Height = 20;
    Edit1 -> Left = 110;
    Edit1 -> Top = 305;

BitBtn1 -> Font -> Size = 12;
BitBtn1 -> Font -> Color = clBlue;
BitBtn1 -> Font -> Style = TFontStyles ( ) << fsItalic;
BitBtn1 -> Top = 305;
BitBtn1 -> Left = 210;
BitBtn1 -> Height = 23;
BitBtn1 -> Width = 30;
BitBtn1 -> Caption = "Ok";

BitBtn2 -> Font -> Size = 12;
BitBtn2 -> Font -> Color = clBlue;
BitBtn2 -> Font -> Style = TFontStyles ( ) << fsItalic;
BitBtn2 -> Top = 305;
BitBtn2 -> Left = 460;
BitBtn2 -> Height = 23;
BitBtn2 -> Width = 50;
BitBtn2 -> Caption = "Sair";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Imprime_matriz ( TObject* Sender ) {
//SENTIU FALTA DE ALGUNS CÓDIGOS?
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click ( TObject *Sender ) {
   Close ( );
}
//---------------------------------------------------------------------------

terça-feira, 26 de janeiro de 2021

FMX - separando e contando vogais e consoantes


Aqui está um exemplo de um programa que está
programado para contar e separar consoantes
e vogais contidas numa frase inserida pelo
usuário pela entrada de dados feita com um
Objeto TEdit do C++ builder, na verdade o
O TEdit possui diversas propriedades interessantes,
e a mais adequada neste caso é a FilterChar,
simplesmente poderíamos bloquear os caracteres
que não  fosse de nosso interesse passar,
mas nós começamos no mundo da programação,
estudando linguagem C, e em C quase tudo
temos que fazer na mão, e isto muitas das vezes,
é muito gratificante, saber como as coisas funcionam.
No nosso exemplo tudo se baseia em comparações,
temos um Array de char do C predefinido e inicializado,
com os caracteres das vogais minúsculas, e maiúsculas
que será comparado com o array de char que recebeu
da entrada os seus valores.
Sem enrolação testem isto agora mesmo,
ou pelo menos aproveitem toda a lógica do programa
que foi criada em linguagem C, e que pode ser
traduzida em diversas outras linguagens.



//---------------------------------------------------------------------------

#include <fmx.h>
#pragma hdrstop
#include <math.h>
#include "Unit1.h"
#include "stdlib.h"
#include "time.h"
#define tam 6
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1 ( TComponent* Owner )
: TForm ( Owner )
{
}
//---------------------------------------------------------------------------
TText *Text1;
TText *Text2;
TText *Text3;
TText *Text4;
TText *Text5;
TText *Text6;
TText *Text7;
TButton *Button1;

int a, b, m, x, t;
//---------------------------------------------------------------------------
void __fastcall TForm1::Label_Manual ( TObject *Sender ) {
Rectangle1 -> Width = 600;
Rectangle1 -> Height = 340;
Rectangle1 -> Position -> X = 0;
Rectangle1 -> Position -> Y = 0;
Rectangle1 -> Fill -> Color = ( RGB ( 255, 0, 205 ) );
Rectangle1 -> Size -> PlatformDefault = False;
Rectangle1 -> Stroke -> Color = claRed;
//Rectangle1 -> Stroke -> Kind = TBrushKind::Solid;
//Rectangle1 -> Stroke -> Color = ( RGB ( 255, 255, 0 ) );
Rectangle1 -> Stroke -> Thickness = 10;
Rectangle1 -> XRadius = 15;
Rectangle1 -> YRadius = 15;

Label1 -> Position -> X = 170;
Label1 -> Position -> Y = 250;
Label1 -> Size -> Width = 200;
Label1 -> Size -> Height = 30;
Label1 -> TextSettings -> Font -> Size = 18;
Label1 -> TextSettings -> FontColor = claBlack;
Label1 -> TextSettings -> Font -> Family = "Consolas";
Label1 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
Label1 -> Text = "Por: Samuel Lima";

Label2 -> Position -> X = 170;
Label2 -> Position -> Y = 265;
Label2 -> Size -> Width = 200;
Label2 -> Size -> Height = 30;
Label2 -> TextSettings -> Font -> Size = 18;
Label2 -> TextSettings -> FontColor = claBlack;
Label2 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
Label2 -> Text = "sa_sp10@hotmail.com";

Text1  = new TText ( this );
Text1 -> Parent = Form1;
//Text1 -> AutoSize = True;
Text1 -> Position -> X = -55;
Text1 -> Position -> Y = 17;
Text1 -> Size -> Width = 700;
Text1 -> Size -> Height = 20;
Text1 -> TextSettings -> Font -> Size = 16;
Text1 -> TextSettings -> FontColor = claRed;
Text1 -> Size -> PlatformDefault = False;
Text1 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;

Text2  = new TText ( this );
Text2 -> Parent = Form1;
//Text2 -> AutoSize = True;
Text2 -> Position -> X = -145;
Text2 -> Position -> Y = 47;
Text2 -> Size -> Width = 700;
Text2 -> Size -> Height = 20;
Text2 -> TextSettings -> Font -> Size = 14;
Text2 -> TextSettings -> FontColor = claBlack;
Text2 -> Size -> PlatformDefault = False;
Text2 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;

Text3  = new TText ( this );
Text3 -> Parent = Form1;
//Text3 -> AutoSize = True;
Text3 -> Position -> X = -145;
Text3 -> Position -> Y = 67;
Text3 -> Size -> Width = 700;
Text3 -> Size -> Height = 20;
Text3 -> TextSettings -> Font -> Size = 14;
Text3 -> TextSettings -> FontColor = claRed;
Text3 -> Size -> PlatformDefault = False;
Text3 -> Font -> Style = TFontStyles ( ) << fsItalic;

Text4  = new TText ( this );
Text4 -> Parent = Form1;
//Text1 -> AutoSize = True;
Text4 -> Position -> X = -70;
Text4 -> Position -> Y = 87;
Text4 -> Size -> Width = 700;
Text4 -> Size -> Height = 20;
Text4 -> TextSettings -> Font -> Size = 14;
Text4 -> TextSettings -> FontColor = claBlack;
Text4 -> Size -> PlatformDefault = False;
Text4 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;

Text5  = new TText ( this );
Text5 -> Parent = Form1;
//Text5 -> AutoSize = True;
Text5 -> Position -> X = -185;
Text5 -> Position -> Y = 107;
Text5 -> Size -> Width = 700;
Text5 -> Size -> Height = 20;
Text5 -> TextSettings -> Font -> Size = 14;
Text5 -> TextSettings -> FontColor = claRed;
Text5 -> Size -> PlatformDefault = False;
Text5 -> Font -> Style = TFontStyles ( ) << fsItalic;

Text6  = new TText ( this );
Text6 -> Parent = Form1;
//Text6 -> AutoSize = True;
Text6 -> Position -> X = -80;
Text6 -> Position -> Y = 127;
Text6 -> Size -> Width = 700;
Text6 -> Size -> Height = 20;
Text6 -> TextSettings -> Font -> Size = 14;
Text6 -> TextSettings -> FontColor = claBlack;
Text6 -> Size -> PlatformDefault = False;
Text6 -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;

Text7  = new TText ( this );
Text7 -> Parent = Form1;
//Text7 -> AutoSize = True;
Text7 -> Position -> X = -185;
Text7 -> Position -> Y = 147;
Text7 -> Size -> Width = 700;
Text7 -> Size -> Height = 20;
Text7 -> TextSettings -> Font -> Size = 14;
Text7 -> TextSettings -> FontColor = claRed;
Text7 -> Size -> PlatformDefault = False;
Text7 -> Font -> Style = TFontStyles ( ) << fsItalic;

Edit1 -> SetFocus ( );
Edit1 -> Font -> Size = 12;
    Edit1 -> TextSettings -> FontColor = claRed;
Edit1 -> Width = 130;
Edit1 -> Height = 17;
Edit1 -> Position -> X = 277;
Edit1 -> Position -> Y = 47;

Button1  = new TButton ( this );
Button1 -> Parent = Form1;
Button1 -> Width = 30;
Button1 -> Height = 17;
Button1 -> Position -> X = 415;
Button1 -> Position -> Y = 47;
Button1 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
Button1 -> TextSettings -> Font -> Family = "Arial";
Button1 -> TextSettings -> Font -> Size = 16;
Button1 -> TextSettings -> FontColor = claRed;
Button1 -> Text = "Ok";
Button1 -> OnClick = Button1Click;

Button2 -> Width = 50;
Button2 -> Height = 17;
Button2 -> Position -> X = 470;
Button2 -> Position -> Y = 300;
Button2 -> TextSettings -> Font -> Style = TFontStyles ( ) << fsBold << fsItalic;
Button2 -> TextSettings -> Font -> Family = "Arial";
Button2 -> TextSettings -> Font -> Size = 16;
Button2 -> TextSettings -> FontColor = claRed;
Button2 -> Text = "Sair";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow ( TObject *Sender ) {
Label_Manual ( Sender );
Text1 -> Text = "FMX - SEPARANDO VOGAIS E CONSOANTES EM FRASES";
a = 0;
if ( a == 0 )
Text2 -> Text = "Digite uma frase : ";
Button2 -> Visible = false;
Label1 -> Visible = false;
Label2 -> Visible = false;
Edit1 -> Visible = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click ( TObject *Sender ) {
int i, j, k, h = 0, lenv, lenv_1;
char Vogais [ ] = { 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U' };
lenv_1 = strlen ( Vogais );

char str [ 50 ];
char Vet [ 50 ];
String st;
st += Edit1 -> Text;
AnsiString str_1 = Edit1 -> Text;
if ( str_1 != "" ) {
a++;
    }

wcstombs (  str, st.c_str ( ), 50 );
lenv = strlen ( str );
if ( a == 1 ) {
Edit1 -> Visible = false;
Text2 -> Text = "Abaixo a frase digitada: ";
Button1 -> Width = 100;
Button1 -> Height = 17;
Button1 -> Position -> X = 130;
Button1 -> Position -> Y = 300;
Button1 -> TextSettings -> Font -> Family = "Arial";
Button1 -> TextSettings -> Font -> Size = 16;
Button1 -> TextSettings -> FontColor = claRed;
Button1 -> Text = "Pressione";
for ( i = 0; i < lenv; i++ ) {
Text3 -> Text += str [ i ];
}
}
if ( a == 2 ) {
Text4 -> Text = "Imprimindo abaixo só as ";

for ( i = 0; i < lenv; i++ ) {
for ( j = 0; j < lenv; j++ )
if ( str [ i ] == Vogais [ j ] ) {
break;
}
if ( j == lenv ) {   x++;
Text5 -> Text += str [ i ];
}
if ( str [ i ] == ' ' )
t++;
  }

x = x - t;
Text4 -> Text = Text4 -> Text + x;
Text4 -> Text = Text4 -> Text  + " consoantes da frase";
}
//==========================================================================
if ( a == 3 ) {
Text6 -> Text = "Imprimindo abaixo só as ";
for ( i = 0; i < lenv; i++ ) {
for ( j = 0; j < lenv_1; j++ ) {
if ( Vogais [ j ] == str [ i ] ) {
Vet [ h ] = str [ i ];
h++;
m++;
}
}
}
Text6 -> Text = Text6 -> Text + m;
Text6 -> Text = Text6 -> Text + " vogais da frase";
k = h;
for ( h = 0; h < k; h++ ) {
Text7 -> Text += Vet [ h ];
}
Button1 -> Text = "Nova frase";
Button2 -> Visible = true;
Label1 -> Visible = true;
Label2 -> Visible = true;
}
if ( a == 4 ) {
m = 0;
x = 0;
t = 0;
        Text2 -> Text = " ";
Text3 -> Text = " ";
Text4 -> Text = " ";
Text5 -> Text = " ";
Text6 -> Text = " ";
Text7 -> Text = " ";
Edit1 -> Text = "";
Button1 -> Visible = false;
FormShow ( Sender );
}
if ( str_1 == "" ) {
Beep ( 500, 500 );
Edit1 -> SetFocus ( );
return;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click ( TObject *Sender ) {
   Close ( );
}
//---------------------------------------------------------------------------