<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6255869376176704484</id><updated>2026-10-07T00:03:20.823-07:00</updated><category term="Delphi"/><category term="Tutoriais Delphi"/><category term="Notícias"/><category term="Java"/><category term="Tutoriais C#"/><category term="C#"/><category term="Tutoriais"/><category term="assembly"/><category term="C++"/><category term="PHP"/><category term="Pascal"/><category term="Rad Studio"/><category term="Tutoriais Assembly"/><category term="Tutoriais Java"/><category term="Updates"/><category term="Banco de Dados"/><category term="Componentes"/><category term="Cursos"/><category term="MySQL"/><category term="Outros"/><category term="Relatórios"/><category term="XE2"/><category term="XE3"/><category term=".NET"/><category term="ASP.NET"/><category term="Action Script"/><category term="Algoritmo"/><category term="Android"/><category term="Criptografia"/><category term="Excel"/><category term="Flash"/><category term="Frameworks"/><category term="Games"/><category term="HTML5"/><category term="J#"/><category term="JSP"/><category term="Java Script"/><category term="Metropolis"/><category term="PHP5"/><category term="Rave Reports"/><category term="Segurança"/><category term="Tutoriais ActionScript"/><category term="Tutoriais Excel"/><category term="Tutoriais HTML5"/><category term="Tutoriais PHP"/><category term="Tutoriais Pascal"/><category term="Tutoriais Web"/><category term="Tutoriais XML"/><category term="Tutorial Asp.NET"/><category term="Unity"/><category term="VBA"/><category term="Visual Studio"/><category term="Web"/><category term="XML"/><category term="Yii Framework"/><title type='text'>Programador Online</title><subtitle type='html'>Dicas e Tutoriais sobre Programação</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>92</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-410475186309717822</id><published>2014-05-01T19:50:00.002-07:00</published><updated>2014-05-01T19:50:52.724-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais C#"/><title type='text'>Lendo e Inserindo Registros no Regedit - C#</title><content type='html'>Vamos aprender neste tutorial como manipular o editor de registros do Windows.&lt;br /&gt;
Primeiramente precisamos saber quais são os diretórios de registros que o Windows possui.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibQM9lAXyyrBwVuW0k6zEiY4jM9SKgmxWeIUJH46joH1FbONknKPOHkmgiHTa7C9SDosIge5uJ33HwbdBtoGPbItnE70WahKVb8-mVRkYD_7I3mPi8H9uUXOgIA8_vaTljMgq52ZucXs99/s1600/regedit1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibQM9lAXyyrBwVuW0k6zEiY4jM9SKgmxWeIUJH46joH1FbONknKPOHkmgiHTa7C9SDosIge5uJ33HwbdBtoGPbItnE70WahKVb8-mVRkYD_7I3mPi8H9uUXOgIA8_vaTljMgq52ZucXs99/s1600/regedit1.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
No desenvolvimento com C# utilizando o .Net Framework, temos a classe &lt;b&gt;Microsoft.Win32&lt;/b&gt;, que trata de funções sobre gerenciamento de hardware e alguns recursos do próprio sistema operacional. Uma dessas &quot;funções&quot; é a manipulação do Regedit.&lt;br /&gt;
&lt;br /&gt;
Para iniciarmos, precisamos importar essa classe.&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using Microsoft.Win32;
&lt;/pre&gt;
&lt;br /&gt;
Agora temos disponíveis a classe &lt;b&gt;RegistryKey&lt;/b&gt; que representa uma chave de registro, como o próprio nome diz. Então vamos começar.&lt;br /&gt;
&lt;br /&gt;
Vamos declarar uma variável e associarmos à ela algum diretório de registro que queremos manipular.&lt;br /&gt;
Em C#, identificamos cada pasta pelo seguinte código:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ClassesRoot&lt;/b&gt; &lt;b&gt;= &lt;/b&gt;HKEY_CLASSES_ROOT&lt;br /&gt;
&lt;b&gt;CurrentUser&amp;nbsp; &lt;/b&gt;= HKEY_CURRENT_USER&lt;br /&gt;
&lt;b&gt;LocalMachine &lt;/b&gt;= HKEY_LOCAL_MACHINE&lt;br /&gt;
&lt;b&gt;Users &lt;/b&gt;= HKEY_USERS&lt;br /&gt;
&lt;b&gt;CurrentConfig &lt;/b&gt;= HKEY_CURRENT_CONFIG&lt;br /&gt;
&lt;br /&gt;
Então, nosso código fica assim:&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;RegistryKey registro;
registro = Registry.CurrentUser;&lt;/pre&gt;
&lt;br /&gt;
Agora podemos definir o que queremos fazer dentro desse registro. Para inserirmos um valor por exemplo, usamos &lt;b&gt;SetValue(&lt;/b&gt;registro, valor_registro)&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;registro.SetValue(&quot;MeuRegistro&quot;, &quot;Programador Online&quot;);
&lt;/pre&gt;
&lt;br /&gt;
Dessa forma criamos um registro na raiz do diretório HKEY_CURRENT_USER.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsL4z_bRf3jg4fiWWtsTWI8tBuqAJNTNwCqfcIop_VmMlf4HMPiy4dR4nMgIVEoaY-I-_9RNYPa4KU6QAXXIoCxsv2lWQzjPZq3CHXpYKbJgn_PhlIEDnjsyniQZWu6tdLnya5EJwHNLir/s1600/regedit2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsL4z_bRf3jg4fiWWtsTWI8tBuqAJNTNwCqfcIop_VmMlf4HMPiy4dR4nMgIVEoaY-I-_9RNYPa4KU6QAXXIoCxsv2lWQzjPZq3CHXpYKbJgn_PhlIEDnjsyniQZWu6tdLnya5EJwHNLir/s1600/regedit2.PNG&quot; height=&quot;194&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Para criarmos uma pasta dentro desse diretório, usamos o método &lt;b&gt;CreateSubKey&lt;/b&gt; logo quando definimos a nossa chave de registro.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;RegistryKey registro;
registro = Registry.CurrentUser.CreateSubKey(&quot;MinhaSubKey&quot;);
&lt;/pre&gt;
&lt;br /&gt;
Agora podemos adicionar um novo registro.&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;registro.SetValue(&quot;MeuRegistro&quot;, &quot;Programador Online&quot;);
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSGmutk1911p5eivg3MttSCB2zwJ5XuEUoKXDn7NQwPXQxd0v9CrW2p_e4IvD5GqFTV9WIve4J1MJ9vhZLAtjxhU7XYt-xAxnIbP_tqeCS93TTbEqyIriMNDfg0loibvmpTEgFIEOt0uH6/s1600/regedit3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSGmutk1911p5eivg3MttSCB2zwJ5XuEUoKXDn7NQwPXQxd0v9CrW2p_e4IvD5GqFTV9WIve4J1MJ9vhZLAtjxhU7XYt-xAxnIbP_tqeCS93TTbEqyIriMNDfg0loibvmpTEgFIEOt0uH6/s1600/regedit3.PNG&quot; height=&quot;178&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Para lermos um registro, usamos a mesma lógica só que ao invés de &lt;b&gt;CreateSubKey&lt;/b&gt; usaremos &lt;b&gt;OpenSubKey&lt;/b&gt;.&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// declaro o registro
RegistryKey registro;
// defino a pasta CurrentUser e a subKey que desejo ler
registro = Registry.CurrentUser.OpenSubKey(&quot;MinhaSubKey&quot;);
// defino qual registro quero retornar o valor
string valor = registro.GetValue(&quot;MeuRegistro&quot;).ToString();
// escreve o valor
Console.WriteLine(valor);

Console.ReadKey();
&lt;/pre&gt;
&lt;br /&gt;
Assim, obtemos o valor que o registro HKEY&lt;b&gt;_CURRENT_USER\MinhaSubKey\MeuRegistro&lt;/b&gt; contém.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-GA3d06ukp_pqWb8WhV5G77J1jOcTbMD-Dl3aHkKF4poLJ2OKUNkoEnwTEW_Jfy078o3wgeNXjzAgOx0KFH7O12D2jx-WPFDJgizspUs-HP2UvaXVnu5j2KhzFjm_u2gfoX6d_7Cn4fyS/s1600/regedit4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-GA3d06ukp_pqWb8WhV5G77J1jOcTbMD-Dl3aHkKF4poLJ2OKUNkoEnwTEW_Jfy078o3wgeNXjzAgOx0KFH7O12D2jx-WPFDJgizspUs-HP2UvaXVnu5j2KhzFjm_u2gfoX6d_7Cn4fyS/s1600/regedit4.PNG&quot; height=&quot;197&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
A classe Win32 possui muitas funcionalidades interessantes, inclusive sobre o registro. Vale a pena explorar os métodos que essa classe possui.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Abraços e até a próxima.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/410475186309717822/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2014/05/lendo-e-inserindo-registros-no-regedit-c.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/410475186309717822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/410475186309717822'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2014/05/lendo-e-inserindo-registros-no-regedit-c.html' title='Lendo e Inserindo Registros no Regedit - C#'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibQM9lAXyyrBwVuW0k6zEiY4jM9SKgmxWeIUJH46joH1FbONknKPOHkmgiHTa7C9SDosIge5uJ33HwbdBtoGPbItnE70WahKVb8-mVRkYD_7I3mPi8H9uUXOgIA8_vaTljMgq52ZucXs99/s72-c/regedit1.PNG" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-4908873414356095765</id><published>2014-05-01T12:52:00.001-07:00</published><updated>2014-05-01T12:52:56.588-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais C#"/><title type='text'>Conversor de Imagem - C#</title><content type='html'>Neste tutorial vamos aprender como converter uma imagem para diversos formatos utilizando a classe &lt;b&gt;System.Drawing.Imaging.ImageFormat &lt;/b&gt;que temos no .NET Framework. Ela nos permite salvar uma imagem para um determinado formato. É isso que vamos fazer a partir de um &lt;b&gt;pictureBox&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Primeiramente vamos criar nosso form.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRKgS0-9jCugZr2wZ0TpaIG9dnlKkX7e46uZDd1BCB8FQPSBwbDohyphenhyphen4tdQ5b7gqEru_F5-Sbd1dqXXyuiCg33nEl-jWFCmJ064ep4CQiEmcfaOU4YhmKikxsbyiPuFFdzF0Ib_ejeEXNQ/s1600/layout.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRKgS0-9jCugZr2wZ0TpaIG9dnlKkX7e46uZDd1BCB8FQPSBwbDohyphenhyphen4tdQ5b7gqEru_F5-Sbd1dqXXyuiCg33nEl-jWFCmJ064ep4CQiEmcfaOU4YhmKikxsbyiPuFFdzF0Ib_ejeEXNQ/s1600/layout.PNG&quot; height=&quot;265&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;- btnAbrir&lt;/b&gt;: Botão com &lt;b&gt;Text&lt;/b&gt;&amp;nbsp;= &quot;Abrir Imagem&quot;. Abrirá a imagem a ser convertida.&lt;br /&gt;
&lt;b&gt;- btnConverter&lt;/b&gt;: Botão com&amp;nbsp;&lt;b&gt;Text&lt;/b&gt;&amp;nbsp;= &quot;Converter&quot;. Ação principal que salva a imagem em um novo formato.&lt;br /&gt;
&lt;b&gt;- cboFormato&lt;/b&gt;: ComboBox que terá os possíveis formatos para conversão&lt;br /&gt;
&lt;b&gt;- picImagem&lt;/b&gt;: PictureBox que guardará a imagem a ser convertida.&lt;br /&gt;
&lt;br /&gt;
Vamos programar as ações necessárias para abrirmos a imagem. Evento &lt;b&gt;Click&lt;/b&gt;&amp;nbsp;do &lt;b&gt;btnAbrir&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// Instancia um novo OpenFileDialog
OpenFileDialog dlgAbrir = new OpenFileDialog();
// Definimos o filtro do Dialog
dlgAbrir.Filter = &quot;Arquivos de Imagem | *.png; *.bmp; *.jpg; *.gif&quot;;
// Executa o OpenFileDialog
dlgAbrir.ShowDialog();
 // Pegamos o nome do arquivo selecionado
string nomeArquivo = dlgAbrir.FileName;

// carrega o pictureBox se um arquivo válido foi selecionado
if (nomeArquivo != string.Empty)
{
   picImagem.ImageLocation = nomeArquivo;
   // Ajustamos a imagem ao pictureBox
   picImagem.SizeMode = PictureBoxSizeMode.StretchImage;
}
&lt;/pre&gt;
&lt;br /&gt;
Note que quando criamos o filtro, usei apenas quatro extensões de arquivos, fique por sua conta explorar a classe e ver quais tipos de arquivos são suportados.&lt;br /&gt;
&lt;br /&gt;
Vamos colocar as extensões dos arquivos suportados dentro do ComboBox. Podemos fazer isso através da caixa de Propriedades, mas por fins educativos, vamos fazer isso através de código!&lt;br /&gt;
Dê um duplo clique no formulário e será aberto o evento &lt;b&gt;Load&lt;/b&gt;. Adicione o código que preenche o comboBox.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// Adicionamos os itens
cboFormato.Items.Add(&quot;.bmp&quot;);
cboFormato.Items.Add(&quot;.gif&quot;);
cboFormato.Items.Add(&quot;.jpg&quot;);
cboFormato.Items.Add(&quot;.png&quot;);

// Mudamos o estilo para que o usuário não possa digitar nada
cboFormato.DropDownStyle = ComboBoxStyle.DropDownList;
&lt;/pre&gt;
&lt;br /&gt;
O DropDownStyle também pode ser alterado visualmente.&lt;br /&gt;
&lt;br /&gt;
Agora o que nos resta é o código principal, que pede ao usuário para selecionar uma pasta e salva a imagem em um novo formato.&lt;br /&gt;
Não se esqueça de importar a classe&amp;nbsp;&lt;b&gt;System.Drawing.Imaging.ImageFormat&lt;/b&gt;&amp;nbsp;no topo da classe que está programando.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using System.Drawing.Imaging.ImageFormat;
&lt;/pre&gt;
&lt;br /&gt;
Código do &lt;b&gt;btnConverter&lt;/b&gt;:&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;// Instancia um novo FolderBrowserDialog
FolderBrowserDialog dlgPasta = new FolderBrowserDialog();
// exibe o dialog
dlgPasta.ShowDialog();
 // pega o diretorio selecionado
string diretorio = dlgPasta.SelectedPath;

// verifica se a pasta escolhida é válida
if (diretorio != &quot;&quot;) {
// salva a imagem de acordo com o que foi selecionado na comboBox
   if (cboFormato.Text == &quot;.bmp&quot;)
       picImagem.Image.Save(diretorio + &quot;\\imagem.bmp&quot;, ImageFormat.Bmp);
   else if (cboFormato.Text == &quot;.gif&quot;)
       picImagem.Image.Save(diretorio + &quot;\\imagem.gif&quot;, ImageFormat.Gif);
   else if (cboFormato.Text == &quot;.jpg&quot;)
       picImagem.Image.Save(diretorio + &quot;\\imagem.jpg&quot;, ImageFormat.Jpeg);
   else if (cboFormato.Text == &quot;.png&quot;)
       picImagem.Image.Save(diretorio + &quot;\\imagem.png&quot;, ImageFormat.Png);

// mostra mensagem de sucesso
MessageBox.Show(&quot;Imagem convertida com sucesso!&quot;);
}
&lt;/pre&gt;
&lt;br /&gt;
Você pode tratar Exceções &amp;nbsp;com &lt;b&gt;Try Catch&lt;/b&gt;&amp;nbsp;e aprendendo neste artigo &amp;nbsp;&lt;a href=&quot;http://programadoronline.blogspot.com.br/2012/08/tratando-erros-com-try-catch-em-c.html&quot;&gt;http://programadoronline.blogspot.com.br/2012/08/tratando-erros-com-try-catch-em-c.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
O resultado final é esse:&lt;br /&gt;
&lt;br /&gt;
Imagem carregada:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl_tB4A_1UpjIjDcbR7tPjLk-_70PzBmqId05hqjD7fuNuDn2h_gtSiJP5DzhxlV4YoIo4WSiSUQ5dl6D5_v7mKps2Yp1rYXJoCqZi2kpZsBwD4jIW5jLfLMDsoPnaPbvZDCaDLUax7LCU/s1600/img1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl_tB4A_1UpjIjDcbR7tPjLk-_70PzBmqId05hqjD7fuNuDn2h_gtSiJP5DzhxlV4YoIo4WSiSUQ5dl6D5_v7mKps2Yp1rYXJoCqZi2kpZsBwD4jIW5jLfLMDsoPnaPbvZDCaDLUax7LCU/s1600/img1.PNG&quot; height=&quot;211&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Seleção de alguns dos formatos disponíveis.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKqtFChaoJ3jlAqOCECFT3NPyJQ491P8hujtYjSfGADHz93zNVWiJmhOzHKMSt3QCJ8lfx8qnENoGYGqI3vVN_pRjt5jS5-FjYSE9cLHAot9Sgjq0hygR3J5msj5Z6PtgdrJdLb3_NxPOF/s1600/img2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKqtFChaoJ3jlAqOCECFT3NPyJQ491P8hujtYjSfGADHz93zNVWiJmhOzHKMSt3QCJ8lfx8qnENoGYGqI3vVN_pRjt5jS5-FjYSE9cLHAot9Sgjq0hygR3J5msj5Z6PtgdrJdLb3_NxPOF/s1600/img2.png&quot; height=&quot;209&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Procurar a pasta para salvar a imagem:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFrgIoUQ1pZmsNurOYVKk8m4fMqUc4xwUnkiuINaOoGmO7oGlUpSFvlBj9oofj1Y2oDm5c0cid1J4T67b5eaELet7CV7nZiTcrEgoTph9Zdp24rOknuXxaoZtM6DAStNB83F6yAQ8jvKl/s1600/img3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFrgIoUQ1pZmsNurOYVKk8m4fMqUc4xwUnkiuINaOoGmO7oGlUpSFvlBj9oofj1Y2oDm5c0cid1J4T67b5eaELet7CV7nZiTcrEgoTph9Zdp24rOknuXxaoZtM6DAStNB83F6yAQ8jvKl/s1600/img3.PNG&quot; height=&quot;310&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Imagem convertida com sucesso!&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMRZyaypeblKt71IZZAd6CzvPesS-goSPUSDR2NE0tRoWNFzqqcVixd1GdmB9Qs61QbndBK4s-r7Cb3pEkZxsKigB2NUU3kfjY3PBJ3SeyhVA0T9tdTsp-cZwzlg50ZPvAMKzz3FYaQ1ni/s1600/img4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMRZyaypeblKt71IZZAd6CzvPesS-goSPUSDR2NE0tRoWNFzqqcVixd1GdmB9Qs61QbndBK4s-r7Cb3pEkZxsKigB2NUU3kfjY3PBJ3SeyhVA0T9tdTsp-cZwzlg50ZPvAMKzz3FYaQ1ni/s1600/img4.PNG&quot; height=&quot;209&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;É isso aí. Abraços e até a próxima.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/4908873414356095765/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2014/05/conversor-de-imagem-c.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/4908873414356095765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/4908873414356095765'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2014/05/conversor-de-imagem-c.html' title='Conversor de Imagem - C#'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguRKgS0-9jCugZr2wZ0TpaIG9dnlKkX7e46uZDd1BCB8FQPSBwbDohyphenhyphen4tdQ5b7gqEru_F5-Sbd1dqXXyuiCg33nEl-jWFCmJ064ep4CQiEmcfaOU4YhmKikxsbyiPuFFdzF0Ib_ejeEXNQ/s72-c/layout.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-1422079062431442499</id><published>2013-06-22T19:44:00.000-07:00</published><updated>2013-06-22T19:44:04.709-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Rad Studio"/><title type='text'>Delphi XE4</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Lançado o Delphi XE4 e Rad Studio XE4 com suporte para desenvolvimento de aplicações para iPhone e iPad.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Mais informações:&amp;nbsp;&lt;a href=&quot;http://www.embarcadero.com/br/products/delphi/whats-new&quot;&gt;http://www.embarcadero.com/br/products/delphi/whats-new&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Download Trial:&amp;nbsp;&lt;a href=&quot;http://www.embarcadero.com/br/products/delphi/downloads&quot;&gt;http://www.embarcadero.com/br/products/delphi/downloads&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/RS1rFaRWIzA?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/1422079062431442499/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2013/06/delphi-xe4.html#comment-form' title='6 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1422079062431442499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1422079062431442499'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2013/06/delphi-xe4.html' title='Delphi XE4'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-5790697174498000892</id><published>2013-06-22T19:40:00.000-07:00</published><updated>2013-06-22T19:40:06.942-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JSP"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><title type='text'>request.getParameter - JSP</title><content type='html'>Este tutorial consiste em exemplificar como é feito a passagem de dados para um arquivo JSP.&lt;br /&gt;
Neste exemplo teremos apenas três campos: Nome, Endereço e Telefone.&lt;br /&gt;
&lt;br /&gt;
Primeiramente vamos criar o nosso formulário HTML que o usuário digitará os dados para serem recebidos e mostrados em nosso arquivo JSP.&lt;br /&gt;
Antes de começar, preste atenção no &lt;i&gt;action&lt;/i&gt;&amp;nbsp;do formulário, assim como os &lt;i&gt;names&lt;/i&gt;&amp;nbsp;de cada &lt;i&gt;input&lt;/i&gt;&amp;nbsp;&lt;i&gt;(caixa de texto)&lt;/i&gt;&amp;nbsp;inserido no HTML.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;html&gt;&lt;body style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;pre&gt;
&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;html&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;form method&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;post&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; action&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;cadastro.jsp&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;Nome&lt;span style=&quot;color: #808030;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; name&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;nome&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;E&lt;span style=&quot;color: #808030;&quot;&gt;-&lt;/span&gt;Mail&lt;span style=&quot;color: #808030;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; name&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;email&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;Telefone&lt;span style=&quot;color: #808030;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; name&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;telefone&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;input type&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;submit&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; value&lt;span style=&quot;color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000e6;&quot;&gt;Enviar&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&quot;&lt;/span&gt; &lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;p&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;form&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;body&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
    
&lt;span style=&quot;color: #808030;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #808030;&quot;&gt;/&lt;/span&gt;html&lt;span style=&quot;color: #808030;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/body&gt;&lt;/html&gt;&lt;/pre&gt;
Perceba o &lt;i&gt;action&lt;/i&gt;&amp;nbsp;indicando para &lt;b&gt;cadastro.jsp&lt;/b&gt;. Este é o arquivo que usaremos para receber os dados após o usuário clicar no botão&amp;nbsp;&lt;i&gt;Submit.&lt;/i&gt;&lt;br /&gt;

&lt;i&gt;&lt;br /&gt;&lt;/i&gt;

&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;html&gt;&lt;body style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;pre&gt;
&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;
            &amp;lt;% 
                String nome = request&lt;span style=&quot;color: #008c00;&quot;&gt;.&lt;/span&gt;getParameter(&quot;nome&quot;);
                String email = request&lt;span style=&quot;color: #008c00;&quot;&gt;.&lt;/span&gt;getParameter(&quot;email&quot;);
                String telefone = request&lt;span style=&quot;color: #008c00;&quot;&gt;.&lt;/span&gt;getParameter(&quot;telefone&quot;);
                
                out&lt;span style=&quot;color: #008c00;&quot;&gt;.&lt;/span&gt;println(&quot;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;Nome:&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt; &quot; + nome + &quot;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;&quot;);
                out&lt;span style=&quot;color: #008c00;&quot;&gt;.&lt;/span&gt;println(&quot;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;EMail:&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt; &quot; + email + &quot;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;&quot;);
                out&lt;span style=&quot;color: #008c00;&quot;&gt;.&lt;/span&gt;println(&quot;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;Telefone:&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt; &quot; + telefone + &quot;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;&quot;);
            %&amp;gt;
 &lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;color: #a65700;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;/body&gt;&lt;/html&gt;&lt;/pre&gt;
Na primeira linha do código Java, declaramos uma variável para receber o &lt;i&gt;nome,&lt;/i&gt;&amp;nbsp;onde&amp;nbsp;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;request.getParameter(&quot;nome&quot;); &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;indica o elemento HTML que a propriedade nome seja &quot;nome&quot;. Ou seja, serve para receber os dados de página solicitada, e o parâmetro &lt;i&gt;&quot;nome&quot;&lt;/i&gt;&amp;nbsp;é de onde esse dado veio.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Neste caso é a primeira caixa de texto do HTML. Assim para as outras duas linhas.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Esse comando funciona como o $_POST[&#39;nome&#39;] ou $_GET[&#39;nome&#39;] do PHP.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;out.prinln &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;foi usado para exibir os dados recebidos do HTML.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraço &amp;nbsp;e até a próxima.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/5790697174498000892/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2013/06/requestgetparameter-jsp.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/5790697174498000892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/5790697174498000892'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2013/06/requestgetparameter-jsp.html' title='request.getParameter - JSP'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-1202020086538366302</id><published>2012-12-22T03:24:00.001-08:00</published><updated>2012-12-22T03:24:47.055-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Frameworks"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP5"/><category scheme="http://www.blogger.com/atom/ns#" term="Yii Framework"/><title type='text'>Yii Framework</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://static.yiiframework.com/css/img/logo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://static.yiiframework.com/css/img/logo.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.yiiframework.com/&quot;&gt;Yii &lt;/a&gt;é um framework PHP (PHP5), free e open-source, que promete ajudar no desenvolvimento de aplicações complexas.&lt;br /&gt;
A sigle Yii vem do inglês &quot;Yes, is it&quot; (Sim, isto é), que vem da série de respostas para as perguntas:&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222; line-height: 19px;&quot;&gt;&quot;Is it fast? ... Is it secure? ... Is it professional? ... Is it right for my next project? ...&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #222222; line-height: 19px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Yes, it is!&lt;/strong&gt;&lt;span style=&quot;background-color: white; border: 0px; color: #222222; line-height: 19px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;É rápido? ... É seguro? ... É profissional? ... É certo para meu próximo projeto? ... &lt;b&gt;Sim, isto é!&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
Você pode fazer o download do Yii Framework em&amp;nbsp;&lt;a href=&quot;http://www.yiiframework.com/download/&quot;&gt;http://www.yiiframework.com/download/&lt;/a&gt;&lt;br /&gt;
E pode ver as características em&amp;nbsp;&lt;a href=&quot;http://www.yiiframework.com/features/&quot;&gt;http://www.yiiframework.com/features/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
De primeira impressão o que temos, é que, o framework é sim uma boa escolha. Nas demos que vem junto com ele, tem um blog feito totalmente em Yii.&lt;br /&gt;
O Framework ainda é novo, o projeto foi iniciado em 2008, mas é uma ótima ideia e uma ótima ferramenta para otimizar seu site e desenvolver aplicações complexas.&lt;br /&gt;
Vamos estudar um pouco mais o Yii Framework e trazer tutoriais aqui no blog.&lt;br /&gt;
&lt;br /&gt;
É isso aí, abraços e até a próxima.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sugerido por João Elson</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/1202020086538366302/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/12/yii-framework.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1202020086538366302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1202020086538366302'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/12/yii-framework.html' title='Yii Framework'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-3317867278194975919</id><published>2012-12-22T02:34:00.001-08:00</published><updated>2012-12-22T02:34:44.945-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>Recuperando dados com PHP</title><content type='html'>Estamos de volta! (:&lt;br /&gt;
Nesse artigo, estarei mostrando como é possível recuperar registros do banco de dados com PHP. Essa tarefa consiste em pegar os registros já gravados no banco e exibi-los novamente.&lt;br /&gt;
Suponhamos uma tabela de produtos com três campos: &quot;Id, Descrição, Preço e Quantidade&quot;. Vamos recuperar o registro que possui o Id de número 3.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;background-color: #ffffe8; color: #5f5035; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;// variáveis para a conexão com o banco MySQL&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$server&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&#39;localhost&#39;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$banco&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&#39;nome_do_banco&#39;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&#39;usuario&#39;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$senha&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&#39;senha&#39;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;i&gt;/&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;/ conexão com o banco MySQL&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #400000;&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$server&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$user&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$senha&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #400000;&quot;&gt;mysql_select_db&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$banco&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;// query SQL&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;SELECT descricao, preco, quantidade FROM produtos WHERE id = 3&quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;// executa a query e &#39;grava&#39; o resultado em $res&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$res&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #400000;&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: maroon; font-weight: bold;&quot;&gt;die&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #400000;&quot;&gt;mysql_error&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;// busca os campos da query&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #400000;&quot;&gt;mysql_fetch_array&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$res&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;// armazena cada campo do banco em uma variável&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$desc&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;descricao&quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$preco&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;preco&quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$quant&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;quantidade&quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: dimgrey;&quot;&gt;&lt;i&gt;// exibe o resultado&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: maroon; font-weight: bold;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;Descrição: &quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$desc&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: maroon; font-weight: bold;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;Preço: &quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$preco&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: maroon; font-weight: bold;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #0000e6;&quot;&gt;&quot;Quantidade: &quot;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #808030;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: #797997;&quot;&gt;$quant&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background: #ffffe8; color: black;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #ffffe8; color: #5f5035;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
Dessa forma, exibimos o resultado do item com Id 3.&lt;br /&gt;
Repare que, para buscar os campos dentro do banco de dados, usamos &lt;i&gt;$campo =&lt;/i&gt;&amp;nbsp;&lt;i&gt;mysql_fetch_array($res),&lt;/i&gt;&amp;nbsp;onde &lt;i&gt;$res&lt;/i&gt;&amp;nbsp;é a variável que retorna a query (&lt;i&gt;$res = mysql_query($query);)&lt;/i&gt;.&lt;br /&gt;
Após buscar os campos, armazenamos cada um em uma variável:&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$desc&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;descricao&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$preco&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;preco&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$quant&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;quantidade&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Depois, simplesmente exibimos.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;E para exibir mais de um item?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Simples, vamos criar um laço &lt;i&gt;for&lt;/i&gt;&amp;nbsp;que vá de 0 até o número de registros encontrados na query. Vamos lá.&lt;br /&gt;
Considere que a conexão com o banco já foi feita. Vamos selecionar os registros de 1 a 5.&lt;br /&gt;&lt;span style=&quot;background-color: #ffffe8; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;SELECT descricao, preco, quantidade FROM produtos WHERE id &amp;gt;= 1 AND id &amp;lt;=5&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: dimgrey;&quot;&gt;&lt;i&gt;// executa a query e &#39;grava&#39; o resultado em $res&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$res&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #400000;&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: maroon; font-weight: bold;&quot;&gt;die&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #400000;&quot;&gt;mysql_error&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i style=&quot;color: dimgrey; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; // pega o número de linhas que a query retornou&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #ffffe8; color: #797997; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; $num_reg&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: #808030; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: black; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: #400000; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mysql_num_rows&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: #808030; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: #797997; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$res&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: #808030; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;i style=&quot;color: dimgrey; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;// faz um loop de 0 até o numero de linhas encontradas&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: blue;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #666666;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;=0;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #666666;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #666666;&quot;&gt;$num_reg&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #666666;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;++) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: dimgrey;&quot;&gt;&lt;i&gt;// busca os campos da query&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #400000;&quot;&gt;mysql_fetch_array&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$res&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: dimgrey;&quot;&gt;&lt;i&gt;// armazena cada campo do banco em uma variável&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$desc&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;descricao&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$preco&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;preco&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$quant&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$campo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;quantidade&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: dimgrey;&quot;&gt;&lt;i&gt;// exibe o resultado&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: maroon; font-weight: bold;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;Descrição: &quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$desc&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: maroon; font-weight: bold;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;Preço: &quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$preco&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: maroon; font-weight: bold;&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #0000e6;&quot;&gt;&quot;Quantidade: &quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #808030;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #797997;&quot;&gt;$quant&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: purple;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #660000;&quot;&gt;&lt;b&gt;echo &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: blue;&quot;&gt;&quot;---------------------&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #5f5035;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: #ffffe8; background-position: initial initial; background-repeat: initial initial; color: #5f5035;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffffe8; font-family: inherit;&quot;&gt;Repare que a lógica é praticamente a mesma, a única diferença, é que, usamos &lt;i&gt;mysql_num_rows($res)&lt;/i&gt;&amp;nbsp;que pega o número de linhas que a query retornou.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffffe8; font-family: inherit;&quot;&gt;A partir daí, usamos ela para fazer o loop, que vai de 0 até a variável que armazena as linhas da query (&lt;i&gt;$num_reg =&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;mysql_num_rows($res)).&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffffe8; font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffffe8; font-family: inherit;&quot;&gt;Simples né? É isso aí galera, abraço, bons estudos e até a próxima.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffffe8; font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #ffffe8; font-family: inherit;&quot;&gt;mysql_fetch_array();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://php.net/manual/en/function.mysql-fetch-array.php&quot;&gt;http://php.net/manual/en/function.mysql-fetch-array.php&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
mysql_num_rows();&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://php.net/manual/en/function.mysql-num-rows.php&quot;&gt;http://php.net/manual/en/function.mysql-num-rows.php&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/3317867278194975919/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/12/recuperando-dados-com-php.html#comment-form' title='6 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3317867278194975919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3317867278194975919'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/12/recuperando-dados-com-php.html' title='Recuperando dados com PHP'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-4481617689112434411</id><published>2012-11-16T07:51:00.002-08:00</published><updated>2014-05-01T11:35:45.681-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Games"/><category scheme="http://www.blogger.com/atom/ns#" term="Unity"/><title type='text'>Unity 4 está disponível!</title><content type='html'>Para quem não sabe, Unity é um ambiente de desenvolvimento de jogos. É usado por muitas empresas pelo seu custo/benefício.&lt;br /&gt;
Na nova versão do Unity, ela apresenta o suporte de renderização do DirectX 11, assim como novos recursos de animação, sistemas de partículas e efeitos de imagem.&lt;br /&gt;
Veja alguns dos jogos desenvolvidos usando o Unity.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/cI50qQm5OiM&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;center&gt;
&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
Para mais informações da Engine, visite o site oficial em&amp;nbsp;&lt;a href=&quot;http://unity3d.com/unity/&quot;&gt;http://unity3d.com/unity/&lt;/a&gt;.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;/center&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/4481617689112434411/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/11/unity-4-esta-disponivel.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/4481617689112434411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/4481617689112434411'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/11/unity-4-esta-disponivel.html' title='Unity 4 está disponível!'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/cI50qQm5OiM/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-3117507697729901355</id><published>2012-11-16T07:30:00.000-08:00</published><updated>2012-11-16T08:06:15.731-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="assembly"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Assembly"/><title type='text'>Aprendendo Assembly - Parte 2</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhge5GI4c-YAC4LdyjLld4pfeGMyMJ1X8pQu6ALuFHqyAXM8YIxIO-qbZuzU3xtEE4jhyphenhyphenWrWPeCM-6_z4M-D4kkv836WeMkfsAMmVhfyGPx-SNz-qo6NHYVNgsN2InrW-eQuiNeB4q3gqa/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;234&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhge5GI4c-YAC4LdyjLld4pfeGMyMJ1X8pQu6ALuFHqyAXM8YIxIO-qbZuzU3xtEE4jhyphenhyphenWrWPeCM-6_z4M-D4kkv836WeMkfsAMmVhfyGPx-SNz-qo6NHYVNgsN2InrW-eQuiNeB4q3gqa/s320/2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Continuação da &lt;a href=&quot;http://programadoronline.blogspot.com.br/2012/10/aprendendo-assembly-parte-1.html&quot;&gt;primeira parte&lt;/a&gt; de Aprendendo Assembly. Caso você não tenha lido a primeira parte, leia &lt;a href=&quot;http://programadoronline.blogspot.com.br/2012/10/aprendendo-assembly-parte-1.html&quot;&gt;aqui&lt;/a&gt;.&lt;br /&gt;
Na parte anterior, abordamos o operador aritmético de soma, assim como um breve exemplo do operador de subtração.&lt;br /&gt;
O operador de subtração, assim como todos os outros operadores, são feitos e tratados da mesma maneira.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;__asm {&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&lt;/b&gt;num1, 5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&lt;/b&gt;num2, 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&lt;/b&gt;eax, num1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;sub&amp;nbsp;&lt;/b&gt;eax, num2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;mov&amp;nbsp;&lt;/b&gt;res, eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Na primeira linha, atribuimos o valor 5 para a variável num1, assim como, na segunda linha atribuimos 3 para num2.&lt;/div&gt;
&lt;div&gt;
Na terceira linha, movemos o valor de num1 para o registrador eax. Dessa maneira, eax possui 5.&lt;/div&gt;
&lt;div&gt;
Na quarta linha, subtraímos eax pelo valor de num2. Desta forma, nos da o resultado 2.&lt;/div&gt;
&lt;div&gt;
Na última linha, movemos o conteúdo de eax (2) para a variável res.&lt;/div&gt;
&lt;div&gt;
Desta forma, após declararmos num1, num2 e res como int, podemos exibir o resultado.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&lt;span style=&quot;color: blue;&quot;&gt;&quot;%s%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&quot;NUM1 - NUM2 = &quot;&lt;/span&gt;, res);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A única diferença em multiplicar e dividir valores, é que, não passamos dois parâmetros para o operador. Ex:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov&amp;nbsp;&lt;/b&gt;num1, 5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov&amp;nbsp;&lt;/b&gt;num2, 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov&amp;nbsp;&lt;/b&gt;eax, num1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mul &lt;/b&gt;num2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Para multiplicação, usamos &lt;i&gt;mul.&lt;/i&gt;&amp;nbsp;E não usamos dois parâmetros como &lt;i&gt;add&lt;/i&gt;&amp;nbsp;e &lt;i&gt;sub, &lt;/i&gt;pois quando chamamos o operador de multiplicação, ele faz a operação do parâmetro informado (num2) pelo conteúdo do acumulador (eax).&lt;br /&gt;
Então para multiplicarmos os dois valores, mover o primeiro valor para eax, e depois usar &lt;i&gt;mul&lt;/i&gt;&amp;nbsp;com o segundo valor.&lt;br /&gt;
&lt;br /&gt;
Para divisão usamos a mesma lógica, porém, quando se trata de divisão, tratamos com números quebrados, normalmente float, double ou real.&lt;br /&gt;
Como definimos as variáveis num1, num2 e res como int, devemos converter esse valor para int, pois a divisão nos retorna um número &quot;quebrado&quot; (double).&lt;br /&gt;
Temos 3 tipos de conversão:&lt;br /&gt;
&lt;br /&gt;
- Conversão de &lt;i&gt;byte&lt;/i&gt;&amp;nbsp;para &lt;i&gt;word&lt;/i&gt;: cbw&lt;br /&gt;
- Conversão de &lt;i&gt;double&lt;/i&gt;&amp;nbsp;para &lt;i&gt;quad word: &lt;/i&gt;cdq&lt;br /&gt;
- Conversão de &lt;i&gt;word&lt;/i&gt;&amp;nbsp;para &lt;i&gt;double: &lt;/i&gt;cwd&lt;br /&gt;
&lt;br /&gt;
Em nosso caso, devemos converter o valor de &lt;i&gt;double&lt;/i&gt;&amp;nbsp;para &lt;i&gt;quad word.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Quad Word&lt;/i&gt;&amp;nbsp;é uma variável do tipo inteiro de 64 bits, semelhante a um &lt;i&gt;int64, word...&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Então, antes de iniciar a divisão, devemos converter o valor do acumulador (eax) para &lt;i&gt;quad word&lt;/i&gt;&amp;nbsp;e dividir pelo segundo valor (num2).&lt;br /&gt;
Desta forma, temos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov&amp;nbsp;&lt;/b&gt;num1, 14&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov&amp;nbsp;&lt;/b&gt;num2, 2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov&amp;nbsp;&lt;/b&gt;eax, num1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;cdq&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;b&gt;div &lt;/b&gt;num2&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
mov res, eax&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;O resultado retornado é 7.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
O desenvolvimento começa a ficar mais interessante, quando passamos a receber entrada de dados do usuário.&lt;br /&gt;
Antes de começarmos a próxima parte falando sobre como criar uma aplicação inteira em Assembly, mostrarei como é feito o input usando o C++ como linguagem &quot;mãe&quot;.&lt;br /&gt;
Usaremos o &lt;i&gt;scanf &lt;/i&gt;do C++ para fazer a leitura das teclas, e a partir daí, passaremos os dados para os registradores. Veja um exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;int &lt;/b&gt;_tmain(&lt;b&gt;int &lt;/b&gt;argc, _TCHAR* argv[])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;int &lt;/b&gt;num1, num2, res;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&lt;span style=&quot;color: blue;&quot;&gt;&quot;Digite um numero: &quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;scanf(&lt;span style=&quot;color: blue;&quot;&gt;&quot;%d&quot;&lt;/span&gt;, &amp;amp;num1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&lt;span style=&quot;color: blue;&quot;&gt;&quot;Digite outro numero: &quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;scanf(&lt;span style=&quot;color: blue;&quot;&gt;&quot;%d&quot;&lt;/span&gt;, &amp;amp;num2);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;__asm &lt;/b&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;b&gt;mov &lt;/b&gt;eax, num1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;b&gt;add &lt;/b&gt;eax, num2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;b&gt;mov &lt;/b&gt;res, eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&lt;span style=&quot;color: blue;&quot;&gt;&quot;%s%d&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&quot;Resultado = &quot;&lt;/span&gt;, res);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;getchar();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Usamos o scanf para fazer a leitura dos dados, e logo após ler os dois valores, passamos &lt;i&gt;num1 &lt;/i&gt;para &lt;i&gt;eax&lt;/i&gt;&amp;nbsp;e adicionamos &lt;i&gt;num2&lt;/i&gt;&amp;nbsp;para &lt;i&gt;eax.&lt;/i&gt;&amp;nbsp;Neste exemplo como podem perceber, foi usado uma soma.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Dessa forma, podemos manipular todos os dados com Assembly, até podemos criar uma aplicação inteira do zero.&lt;/span&gt;&lt;br /&gt;
Abraços e até o próximo capítulo.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img border=&quot;0&quot; src=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=158678&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; /&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://links.lomadee.com/ls/dWVnTDs0azduV3B4UzsyNTAxNjE5MzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;Fundamentos em Programação&lt;/a&gt;&lt;/span&gt;&lt;a href=&quot;http://links.lomadee.com/ls/dWVnTDs0azduV3B4UzsyNTAxNjE5MzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;Assembly&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=981008&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img border=&quot;0&quot; src=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=981008&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://links.lomadee.com/ls/Tk04bjtsS0tvb0tOXzsyNTAxNjIyMzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;80x86 Assembly Language Architeture&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/3117507697729901355/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/11/aprendendo-assembly-parte-2.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3117507697729901355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3117507697729901355'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/11/aprendendo-assembly-parte-2.html' title='Aprendendo Assembly - Parte 2'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhge5GI4c-YAC4LdyjLld4pfeGMyMJ1X8pQu6ALuFHqyAXM8YIxIO-qbZuzU3xtEE4jhyphenhyphenWrWPeCM-6_z4M-D4kkv836WeMkfsAMmVhfyGPx-SNz-qo6NHYVNgsN2InrW-eQuiNeB4q3gqa/s72-c/2.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-1599747792590397246</id><published>2012-10-27T16:12:00.000-07:00</published><updated>2012-10-27T16:12:45.812-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Configurando o Eclipse para desenvolvimento Android</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://developer.android.com/images/sdk-cube.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;211&quot; src=&quot;http://developer.android.com/images/sdk-cube.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Este tutorial tem o intuito de configurar as ferramentas e plug-ins necessários para o desenvolvimento Android com o Eclipse.&lt;br /&gt;
Para o desenvolvimento Android, usaremos um plug-in chamado ADT for Eclipse.&lt;br /&gt;
&lt;br /&gt;
- Primeiramente faça o download do Android SDK em&amp;nbsp;&lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;i&gt;Obs: Após o Download e instalação do SDK, abra o Android SDK Manager e instale as APIs para a versão que você vai desenvolver.&lt;/i&gt;&lt;br /&gt;
- Baixe o Eclipse for &amp;nbsp;Java EE Developers em &amp;nbsp;&lt;a href=&quot;http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1&quot;&gt;http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1&lt;/a&gt;&lt;br /&gt;
- Após instalado o Android SDK, abra o Eclipse, clique em &lt;b&gt;Help | Install New Software...&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxe9FgqgexWjSBOcLQsW7mEdL2SfcvCQ1-pflvZ7-eGZc_ca_o92NK3kcMUA2Q8vrmPkqXjODZUIVTpmfXvrkYTEfn4t2wKyeL4ETjhbvG4yIaTxvO1om5-la4ZanmbUdhfckgkX7uVpu-/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxe9FgqgexWjSBOcLQsW7mEdL2SfcvCQ1-pflvZ7-eGZc_ca_o92NK3kcMUA2Q8vrmPkqXjODZUIVTpmfXvrkYTEfn4t2wKyeL4ETjhbvG4yIaTxvO1om5-la4ZanmbUdhfckgkX7uVpu-/s320/1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Na janela que se abre, clique em &lt;b&gt;Add...&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif_g-jZ48_ZI_uAoctBAEBuL7iyUjTN9yQhSVb7RoEJvGDelsmi_0psIuM6de_5UQDz2z5f7dlllHbfgLewzakfEF6fR0FskWcxn6oaN4ydR69hr21SedAsR6i2fxEfRwsoYlBm6OgHJKC/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif_g-jZ48_ZI_uAoctBAEBuL7iyUjTN9yQhSVb7RoEJvGDelsmi_0psIuM6de_5UQDz2z5f7dlllHbfgLewzakfEF6fR0FskWcxn6oaN4ydR69hr21SedAsR6i2fxEfRwsoYlBm6OgHJKC/s400/2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Digite o nome do Plug-in (Qualquer nome) e no campo abaixo digite:&lt;br /&gt;
&lt;br /&gt;
https://dl-ssl.google.com/android/eclipse/&lt;br /&gt;
&lt;br /&gt;
e clique em OK.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhocPoiD5Cc3wvxoNR3q46e-qbUSLxdy12Cp8Iv6nFrwQiQtgUfB0JUymp-aEo3K-PFWtbuWtOkAOlSuwm_3pqU3fKrvVQ6-rmV0OXOBRmuGHoJSL3j4Z-Gai4C3cTxNCaLTsYALwR4XSe8/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;126&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhocPoiD5Cc3wvxoNR3q46e-qbUSLxdy12Cp8Iv6nFrwQiQtgUfB0JUymp-aEo3K-PFWtbuWtOkAOlSuwm_3pqU3fKrvVQ6-rmV0OXOBRmuGHoJSL3j4Z-Gai4C3cTxNCaLTsYALwR4XSe8/s320/3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Na próxima janela, marque as duas caixas e lá em baixo, clique em &lt;b&gt;Next&lt;/b&gt;&amp;nbsp;&lt;b&gt;&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbr9woom__ORLCcR6pJ8kroN-cGiHwWiLhjBS9QFr3mhC4gS4UljclmGdCNGpnmXAVzYT0QR-L8PWmAQSLJqMVLufdcJRVHDzY1lg0v2rn3epn-MgBL_Ely1S95OkvqmbBMtE7FpVCYcRS/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbr9woom__ORLCcR6pJ8kroN-cGiHwWiLhjBS9QFr3mhC4gS4UljclmGdCNGpnmXAVzYT0QR-L8PWmAQSLJqMVLufdcJRVHDzY1lg0v2rn3epn-MgBL_Ely1S95OkvqmbBMtE7FpVCYcRS/s400/4.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Avance até chegar ao contrato de licença, marque &lt;b&gt;I accept the terms of the license agreements&lt;/b&gt;&amp;nbsp;e clique em &lt;b&gt;Finish.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzBWR7BJXt6Pt2_TMWflsQlE8LD4uIreZVTVxCNlRtJyfQ-qTC6-q-eCLFYV4gEwJxL-x4YmgpS-3HtkCpKoX3zWygu5dl0hVjWilvz-SwRnMmbIz0Ig00XtiYJdvOH1tO2gRiXk3UBSVp/s1600/5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzBWR7BJXt6Pt2_TMWflsQlE8LD4uIreZVTVxCNlRtJyfQ-qTC6-q-eCLFYV4gEwJxL-x4YmgpS-3HtkCpKoX3zWygu5dl0hVjWilvz-SwRnMmbIz0Ig00XtiYJdvOH1tO2gRiXk3UBSVp/s320/5.png&quot; width=&quot;314&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Aguarde o download e a instalação...&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyv9x3H8qx6pfRij5Lt5ub0YMU6zxAhIIO9bSonsvrRDt_YSnErOgclBSmGnpkkZN2ijJVlwYSqXccfcj-8UaGEAbTcJRdWX5NXnKnijX4mO5OwqQElUsD8hwujh9PAYSWaifv2De-CIrG/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyv9x3H8qx6pfRij5Lt5ub0YMU6zxAhIIO9bSonsvrRDt_YSnErOgclBSmGnpkkZN2ijJVlwYSqXccfcj-8UaGEAbTcJRdWX5NXnKnijX4mO5OwqQElUsD8hwujh9PAYSWaifv2De-CIrG/s320/6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Agora está tudo pronto para o desenvolvimento Android no Eclipse. Basta iniciar uma nova aplicação, &lt;b&gt;File | New | Project...| &lt;/b&gt;e podemos ver os tipos de aplicação e templates para Android.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpnLGdsuCpxiTy1nF94javm3F8Gw7IesHnh0dMO2bzxsnTcxkJ3xPAdbrHCHWzKOwpZk0Q3N6EHDlVptOHc7_CR1cQb9rOpoi1iIR_lNrT0A5eXUybFoPgGbXFwCl7ZG7cGLg4kl0qEfax/s1600/7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;304&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpnLGdsuCpxiTy1nF94javm3F8Gw7IesHnh0dMO2bzxsnTcxkJ3xPAdbrHCHWzKOwpZk0Q3N6EHDlVptOHc7_CR1cQb9rOpoi1iIR_lNrT0A5eXUybFoPgGbXFwCl7ZG7cGLg4kl0qEfax/s320/7.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Na primeira criação de uma nova aplicação Java, o plug-in pode pedir atualização. Atualize-o!&lt;br /&gt;
Logo, temos a interface de desenvolvimento com a paleta de componentes.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Y7CiybTfb5uyz1sZRUynbOQZhUI6ZMTVh-qWlvKYjO_KyVL1dzyGgri_jCdNjyzMXCGxle5WkBw9AnmCtDfXwwmlQ2s6cJeC0nR156F8yQ6TnvT9nTK-ZBjyNowotWFx9BTeRDNsPEb6/s1600/8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Y7CiybTfb5uyz1sZRUynbOQZhUI6ZMTVh-qWlvKYjO_KyVL1dzyGgri_jCdNjyzMXCGxle5WkBw9AnmCtDfXwwmlQ2s6cJeC0nR156F8yQ6TnvT9nTK-ZBjyNowotWFx9BTeRDNsPEb6/s400/8.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;Pronto, agora o Eclipse está configurado para desenvolver aplicações Android. Abraços e até a próxima.&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=3696519&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=3696519&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://links.lomadee.com/ls/WWFycDs5NUtDSHNhbDsyNTAyNzMzMTswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;Introdução ao Desenvolvimento de aplicativos para o Android&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Crie aplicativos para o SO Android mais recente O SO Android é uma plataforma popular e flexível para muitos dos mais desejados dispositivos móveis modernos. Este guia oferece uma introdução prática à criação de aplicativos para o Android para os dispositivos móveis mais recentes...&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://links.lomadee.com/ls/WWFycDs5NUtDSHNhbDsyNTAyNzMzMTswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;Ir até a loja&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=3048900&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=3048900&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;a href=&quot;http://links.lomadee.com/ls/YnpuTjt6d0ZSSW9~cjsyNTAyNzMzNzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;Google Android - Aprenda a Criar Aplicações para Dispositivos Móveis com o Android Sdk - 2ª Ed 2010&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
O Android é a plataforma open-source criada pelo Google para o desenvolvimento de aplicações para dispositivos móveis. É a nova sensação do momento e promete revolucionar o desenvolvimento de aplicações...&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://links.lomadee.com/ls/YnpuTjt6d0ZSSW9~cjsyNTAyNzMzNzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;Ir até a loja&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/1599747792590397246/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/10/configurando-o-eclipse-para.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1599747792590397246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1599747792590397246'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/10/configurando-o-eclipse-para.html' title='Configurando o Eclipse para desenvolvimento Android'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxe9FgqgexWjSBOcLQsW7mEdL2SfcvCQ1-pflvZ7-eGZc_ca_o92NK3kcMUA2Q8vrmPkqXjODZUIVTpmfXvrkYTEfn4t2wKyeL4ETjhbvG4yIaTxvO1om5-la4ZanmbUdhfckgkX7uVpu-/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-7393207534285675455</id><published>2012-10-26T12:19:00.001-07:00</published><updated>2012-10-26T12:19:06.413-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Pascal"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Pascal"/><title type='text'>Utilizando a unit Graph - Pascal</title><content type='html'>A unit &lt;i&gt;Graph&lt;/i&gt;&amp;nbsp;é uma unidade de recursos presente na maioria dos compiladores Pascal (Free Pascal...). Neste post estarei mostrando os seus recursos e como usá-los.&lt;br /&gt;
Primeiramente, antes de mais nada, é necessário declarar a &lt;i&gt;uses&lt;/i&gt;&amp;nbsp;&lt;i&gt;Graph.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;uses&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;Graph;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Aqui vou mostrar os principais recursos dessa unit, e um dos mais interessantes e mais usados quando ela é importada, é a manipulação de cores da aplicação.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;A primeira coisa a se fazer quando vamos trabalhar com gráficos, é inicializá-los. Para isso, devemos declarar duas variáveis inteiras, uma para o driver e outra para o tipo de gráfico.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;var &lt;/b&gt;DriverGrafico, TipoGrafico: &lt;span style=&quot;color: blue;&quot;&gt;integer&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
O próximo passo é detectá-lo e inicializar o pacote de gráficos.&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DriverGrafico := Detect;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;TipoGrafico := 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;InitGraph(DriverGrafico, TipoGrafico, &#39; &#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;O último parâmetro refere-se a localização da biblioteca gráfica. Use &#39; &#39; para a localização padrão.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;b&gt;Rectangle&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Essa função é muito simples, e permite desenhar a forma de um retângulo dentro da aplicação.&lt;br /&gt;
Ela é composta por 4 argumentos. &lt;i&gt;Rectangle(X1, Y1, X2, Y2);&lt;/i&gt;&lt;br /&gt;
Basta atribuir os quatro pontos do retângulo para desenhá-lo.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Rectangle(130, 200, 200, 130);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKtrTkCFf2BTIdoVbRpLwKPWO-hByzIWB3p8oWLOWa36mkelK5Gys1tfZUfknzs6PeCn9RdDt47P-LeDworVuJavorAnT6XxASkw4_gTLrMzJ35ZgFGV7p2Tl6etQ4kn9LIJL4Y_YUyjHC/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKtrTkCFf2BTIdoVbRpLwKPWO-hByzIWB3p8oWLOWa36mkelK5Gys1tfZUfknzs6PeCn9RdDt47P-LeDworVuJavorAnT6XxASkw4_gTLrMzJ35ZgFGV7p2Tl6etQ4kn9LIJL4Y_YUyjHC/s320/1.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Circle&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Permite o desenho de um círculo na aplicação. Sintaxe: &lt;i&gt;Circle (X, Y, Tamanho);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Circle(30, 30, 30);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV7AA2Pz2vs12Gr09iQxlphE3zewJCk8OzmkICZmPEyht0HHtKhsXQKEplI6CP4gXjD4cMrpZU_PQWtvhGiNbHCwRjeV9iCRPoC4x16-C695THXjrYzjo2HpscxLLCa64URAyRW3FIlNTL/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV7AA2Pz2vs12Gr09iQxlphE3zewJCk8OzmkICZmPEyht0HHtKhsXQKEplI6CP4gXjD4cMrpZU_PQWtvhGiNbHCwRjeV9iCRPoC4x16-C695THXjrYzjo2HpscxLLCa64URAyRW3FIlNTL/s1600/2.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Dica:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
Adicione um contador &lt;i&gt;While&lt;/i&gt;&amp;nbsp;fazendo com que o círculo seja desenhado um após o outro. Desta maneira:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;while &lt;/b&gt;i &amp;lt; &lt;span style=&quot;color: blue;&quot;&gt;1000 &lt;/span&gt;&lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Circle(i, i, &lt;span style=&quot;color: blue;&quot;&gt;30&lt;/span&gt;); &amp;nbsp; &amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// X=i Y=i&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Delay(&lt;span style=&quot;color: blue;&quot;&gt;100&lt;/span&gt;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// Espera 100&amp;nbsp;milisegundos&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; i := i + &lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// Acrescenta 10 para i&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;end&lt;/b&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Resultado:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3sGddWNPZ7_K4MCtz7XplaipNZsbBg6wQPKPX_RxIE2l3mWCE1F-trs9iHnMAuXclmILcjtC_Sq0WIUz56T2e7QlBDShMPFuH-J3bi68hpO9TRz_oAZB8oq3MYW4HSi5MBzVYQmSWFrTZ/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3sGddWNPZ7_K4MCtz7XplaipNZsbBg6wQPKPX_RxIE2l3mWCE1F-trs9iHnMAuXclmILcjtC_Sq0WIUz56T2e7QlBDShMPFuH-J3bi68hpO9TRz_oAZB8oq3MYW4HSi5MBzVYQmSWFrTZ/s400/1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Escrevendo textos&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Para escrevermos textos utilizando a unit &lt;i&gt;Graph&lt;/i&gt;, temos duas opções. &lt;i&gt;OutText&lt;/i&gt;&amp;nbsp;e &lt;i&gt;OutTextXY&lt;/i&gt;.&lt;br /&gt;
A primeira (OutText) escreve o texto em ordem crescente (da esquerda para a direita).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ6xA2B-HNZcU53aDOofJDx9ilH4c0yRQ1ULW9mgylqm6-l-UqddEwkF7Qk1qyqTP4HWV6qRij8jluK51MgFaCHVFXmDN1lqeB1VJefaVIMvyleYVA-OHwm5ymx8f-k3xGcV9lLJi3-6St/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ6xA2B-HNZcU53aDOofJDx9ilH4c0yRQ1ULW9mgylqm6-l-UqddEwkF7Qk1qyqTP4HWV6qRij8jluK51MgFaCHVFXmDN1lqeB1VJefaVIMvyleYVA-OHwm5ymx8f-k3xGcV9lLJi3-6St/s1600/2.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OutText(&lt;span style=&quot;color: blue;&quot;&gt;&#39;PROGRAMADOR ONLINE&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Podemos definir as coordenadas do texto em X e Y, usando &lt;i&gt;OutTextXY.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OutTextXY(&lt;span style=&quot;color: blue;&quot;&gt;50&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;50&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&#39;PROGRAMADOR ONLINE&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmzDzKI1A0LzQIcu4tRI0SexLg0gJT0Zt3XgCRL3EG3AXvMMepzJkHBFj3j_hpfp_SAYena66SQt968oUMBjeA7gQg6C0LuZTbZCj-DKtpVGM8GHqFu41veshB4OAS65Y3yDrT5rdNXkAV/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmzDzKI1A0LzQIcu4tRI0SexLg0gJT0Zt3XgCRL3EG3AXvMMepzJkHBFj3j_hpfp_SAYena66SQt968oUMBjeA7gQg6C0LuZTbZCj-DKtpVGM8GHqFu41veshB4OAS65Y3yDrT5rdNXkAV/s320/3.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Podemos alterar a cor e o estilo da fonte com &lt;i&gt;SetColor&lt;/i&gt;&amp;nbsp;e &lt;i&gt;SetTextStyle&lt;/i&gt;&amp;nbsp;respectivamente.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SetColor(Yellow); &amp;nbsp; &amp;nbsp;// amarelo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SetTextStyle(SansSerifFont, HorizDir, 5);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;OutTextXY(30&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;,&amp;nbsp;1&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;PROGRAMADOR ONLINE&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5AN4QEKywaAIU__crn5jpPfMaY9u7XV-M3CEXY_SHb0SmVNfWdfxk2OK-_xmd43mGT-fI6ntqS0ZqaJRFwlxYrhmHdzgjdXxMOHGeQbgNYq7LoponsIP0_xC0Pz3HFasTtPZ3GjxaRs38/s1600/4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;57&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5AN4QEKywaAIU__crn5jpPfMaY9u7XV-M3CEXY_SHb0SmVNfWdfxk2OK-_xmd43mGT-fI6ntqS0ZqaJRFwlxYrhmHdzgjdXxMOHGeQbgNYq7LoponsIP0_xC0Pz3HFasTtPZ3GjxaRs38/s400/4.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;A função &lt;i&gt;SetTextStyle&lt;/i&gt;&amp;nbsp;possui três parâmetros. O nome da fonte, a orientação (Vertical/Horizontal) do texto, e o tamanho.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Exitem vários comandos na unit &lt;i&gt;Grahp&lt;/i&gt;&amp;nbsp;é interessante que você mesmo explore-os. Aqui vai uma lista de alguns deles, além dos exemplos acima:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;MoveTo(X, Y) &amp;nbsp; -&amp;gt; Move o ponteiro para a coordenada indicada.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;PutPixel(X, Y, Cor) &amp;nbsp; -&amp;gt; Marca um pixel na orientação indicada&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Line(X, Y) &amp;nbsp; -&amp;gt; Desenha uma linha em X e Y&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;LineTo(X1, Y1, X2, Y2) &amp;nbsp; -&amp;gt; Desenha uma linha nos pontos indicados&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Arc(X, Y, A, B, Dimensão) &amp;nbsp; -&amp;gt; Desenha um arco em X, Y, com ângulo A e B com a dimensão.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;ClearViewPort &amp;nbsp; -&amp;gt; Apaga a tela.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Esses são alguns dos comandos. Espero que o tutorial possa ter ajudado. Abraço, bons estudos e até a próxima!!!&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/7393207534285675455/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/10/utilizando-unit-graph-pascal.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/7393207534285675455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/7393207534285675455'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/10/utilizando-unit-graph-pascal.html' title='Utilizando a unit Graph - Pascal'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKtrTkCFf2BTIdoVbRpLwKPWO-hByzIWB3p8oWLOWa36mkelK5Gys1tfZUfknzs6PeCn9RdDt47P-LeDworVuJavorAnT6XxASkw4_gTLrMzJ35ZgFGV7p2Tl6etQ4kn9LIJL4Y_YUyjHC/s72-c/1.PNG" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-432863848807889483</id><published>2012-10-25T19:34:00.001-07:00</published><updated>2012-11-16T08:06:56.947-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="assembly"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Assembly"/><title type='text'>Aprendendo Assembly - Parte 1</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd-BSUHjy8Rt4jgaTkB4XyG1SmbOPQW56Hp5zVqv_UP75WC-79vym647CL_ZpDsCNvRjU_7a5dksI3HYFNh_cKv9BLj2SEWfKZlxpvUvOd3bq34tQTj0MPie9i5B1HM5t5zkpLzdYD1wxL/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;234&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd-BSUHjy8Rt4jgaTkB4XyG1SmbOPQW56Hp5zVqv_UP75WC-79vym647CL_ZpDsCNvRjU_7a5dksI3HYFNh_cKv9BLj2SEWfKZlxpvUvOd3bq34tQTj0MPie9i5B1HM5t5zkpLzdYD1wxL/s320/1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Quando falamos de Assembly (Assembler é o &quot;compilador&quot;), o que te vem a cabeça?&lt;br /&gt;
Normalmente a primeira impressão que temos, é de que a linguagem é algo incompreensível e difícil de se entender, realmente! Mas esta série de tutoriais tem o intuito de &quot;desmistificar&quot; a linguagem, dando uma pequena noção sobre ela.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Pré-requisitos&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
- Saber programar em alto nível. (C++, Java....)&lt;br /&gt;
- Ter um compilador C++ (Neste tutorial usarei o C++ Builder, serve para o Dev-C++, Visual C++....)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Porque um compilador C++?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Pra começarmos esta série de tutoriais, é necessário aprender a lógica de como os bits trabalham, então neste caso, usaremos o C++ como a linguagem &quot;mãe&quot;, e o Assembly incorporado no código C++. Isso, para termos uma &quot;noção&quot; antes de escrever uma aplicação em Assembly do zero.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Registradores&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Os registradores fazem parte do processador, e são &quot;unidades de memória&quot;, que tem a finalidade de armazenar bits.&lt;br /&gt;
Lembrando que cada processador possui uma linguagem de máquina e de montagem, sendo assim, estarei programando na arquitetura de processadores x86.&lt;br /&gt;
&lt;br /&gt;
EAX -&amp;gt; Registrador acumulador&lt;br /&gt;
EBX -&amp;gt; Registrador de base&lt;br /&gt;
ECX -&amp;gt; Registrador de Laços/Loops/Contador&lt;br /&gt;
EDX -&amp;gt; Registrador de Dados&lt;br /&gt;
.......&lt;br /&gt;
[A lista acima mostra apenas alguns dos registradores]&lt;br /&gt;
&lt;br /&gt;
Para esta primeira parte do tutorial, vamos usar apenas o registrador &lt;i&gt;EAX&lt;/i&gt;, o acumulador, sendo que no decorrer dos tutoriais, vamos saber um pouco mais sobre os outros registradores.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Criando uma aplicação&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Para iniciarmos, vamos criar uma nova aplicação de console no C++ Builder. [Visual C++, Dev-C++...]&lt;br /&gt;
No C++ Builder, basta clicar em &lt;b&gt;New | Other... | Console Application&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
O que temos de início é o código gerado pelo C++ Builder:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#pragma hdrstop&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#pragma argsused&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#include &lt;tchar .h=&quot;.h&quot;&gt;&lt;/tchar&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#include &lt;stdio .h=&quot;.h&quot;&gt;&lt;/stdio&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;_tmain(&lt;span style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;argc, _TCHAR* argv[])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Para incorporar o código Assembly em C++, basta usar o comando &lt;b&gt;__asm.&lt;/b&gt;&lt;br /&gt;
Todo o código Assembly deve estar aí dentro, ex:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;__asm &lt;/b&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;// código assembly aqui&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Agora vamos entender como é que funciona a movimentação de bits dentro do Assembly.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Suponhamos que temos a variável &lt;i&gt;num1&lt;/i&gt;&lt;i&gt;. &lt;/i&gt;Como seria atribuir o valor 5, para essa variável em C++?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;num1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;num1 = &lt;span style=&quot;color: blue;&quot;&gt;5&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Para inicializar uma variável em Assembly, temos que &lt;b&gt;mover&lt;/b&gt; esse valor para ela, da mesma forma de movemos o 5 para o &lt;i&gt;num1&lt;/i&gt;&amp;nbsp;em C++.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;A sintaxe é a seguinte:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;mov &lt;/b&gt;num1, &lt;span style=&quot;color: blue;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
Neste caso, o valor 5 foi movido para a variável&lt;i&gt; num1.&lt;/i&gt;&lt;br /&gt;
Desta forma, podemos inicializar a variável &lt;i&gt;num2&lt;/i&gt;&amp;nbsp;com o número 3.&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;num2,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Simples né? Desta forma podemos inicializar quantas variáveis quisermos.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;Movendo bits para um registrador&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Como vamos utilizar o registrador acumulador, temos que inicializar uma variável e movê-la para o registrador. A sintaxe é a mesma.&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov &lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;eax, num1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Como o valor de &lt;i&gt;num1&lt;/i&gt;&amp;nbsp;era 5, então qual o valor que está no registrador &lt;i&gt;eax&lt;/i&gt;? 5.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Dessa forma, podemos manipular os bits e os valores entre as variáveis e os registradores.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Somando um registrador&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Como já adicionamos o valor da variável ao nosso registrador, vamos inicializar uma outra variável e somar com o &lt;i&gt;num1. &lt;/i&gt;Para somar, usamos o comando &lt;i&gt;add.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;num1, &lt;span style=&quot;color: blue;&quot;&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;//&amp;nbsp;num1 = 5&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;num2,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;//&lt;/i&gt;&lt;i&gt;&amp;nbsp;num2 = 3&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov &lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;eax, num1 &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;// eax = num1&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;add &lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;eax, num2 &amp;nbsp; &amp;nbsp; &lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// eax = eax + num2&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Dessa forma, somamos as duas variáveis &lt;i&gt;num1 + num2&lt;/i&gt;&amp;nbsp;e o resultado está armazenado em &lt;i&gt;eax.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Agora basta mover o valor de &lt;i&gt;eax&lt;/i&gt;&amp;nbsp;para outra variável para que possamos exibir o resultado com o C++.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Movemos da mesma forma:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;res,&amp;nbsp;eax&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Relembrando o código anterior, esta última instrução move o valor de &lt;i&gt;eax&lt;/i&gt;&amp;nbsp;para a variável &lt;i&gt;res.&lt;/i&gt;&lt;br /&gt;
Então, qual é o valor de &lt;i&gt;res&lt;/i&gt;? 8.&lt;br /&gt;
&lt;br /&gt;
Vamos declarar as variáveis no código C++ e compilar nossa aplicação.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;num1, num2, res;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
O código inteiro fica da seguinte maneira.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#pragma hdrstop&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#pragma argsused&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#include &lt;tchar .h=&quot;.h&quot;&gt;&lt;/tchar&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;#include &lt;stdio .h=&quot;.h&quot;&gt;&lt;/stdio&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&amp;nbsp;&lt;/span&gt;_tmain(&lt;span style=&quot;color: blue;&quot;&gt;int&amp;nbsp;&lt;/span&gt;argc, _TCHAR* argv[])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;num1, num2, res;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; __asm&amp;nbsp;&lt;/b&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;num1,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;//&amp;nbsp;num1 = 5&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;num2,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;//&lt;/i&gt;&lt;i&gt;&amp;nbsp;num2 = 3&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;eax, num1 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;i&gt;// eax = num1&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;eax, num2 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// eax = eax + num2&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mov&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;res,&amp;nbsp;eax &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// res = eax&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; printf(&quot;%s%d&quot;, &quot;NUM1 + NUM2 = &quot;, res);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; getchar(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// espera uma tecla&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
O resultado que temos é o seguinte:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9E3qqHlWz9VVTCrvXFjdmd2d2w1k4XMmGdvs1ol6sHKrIcEnojhsL_A5F992WHlhpz_Scp969s9-HCtVUsUi6KVOhIe4Vy8TUQiRlfpXtvpBG39-h_yfwCLqcCITEZBiehX-egbEADyCU/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;118&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9E3qqHlWz9VVTCrvXFjdmd2d2w1k4XMmGdvs1ol6sHKrIcEnojhsL_A5F992WHlhpz_Scp969s9-HCtVUsUi6KVOhIe4Vy8TUQiRlfpXtvpBG39-h_yfwCLqcCITEZBiehX-egbEADyCU/s400/1.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
É recomendável praticar com o comando &lt;i&gt;sub &lt;/i&gt;para fazer subtrações.&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;sub&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;eax, num2 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;// eax = eax - num2&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Na próxima parte do tutorial, falarei sobre as outras operações aritméticas fundamentais e &lt;i&gt;input&lt;/i&gt; de dados do usuário. &lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://programadoronline.blogspot.com.br/2012/11/aprendendo-assembly-parte-2.html&quot;&gt;Parte 2&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Não se esqueça de que este, é apenas um tutorial explicando apenas simplificadamente . Para saber mais sobre Assembly, assim como os fundamentos da linguagem, é recomendado um bom livro!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraços, bons estudos e até a próxima!!!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img border=&quot;0&quot; src=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=158678&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; /&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://links.lomadee.com/ls/dWVnTDs0azduV3B4UzsyNTAxNjE5MzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;Fundamentos em Programação&lt;/a&gt;&lt;/span&gt;&lt;a href=&quot;http://links.lomadee.com/ls/dWVnTDs0azduV3B4UzsyNTAxNjE5MzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;Assembly&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=981008&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img border=&quot;0&quot; src=&quot;http://images.livrariasaraiva.com.br/imagem/imagem.dll?pro_id=981008&amp;amp;L=125&amp;amp;qld=50&amp;amp;A=-1&amp;amp;PIM_Id=&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://links.lomadee.com/ls/Tk04bjtsS0tvb0tOXzsyNTAxNjIyMzswOzE3NjszMzYxODEyMzswO0JSOzM7.html&quot;&gt;80x86 Assembly Language Architeture&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/432863848807889483/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/10/aprendendo-assembly-parte-1.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/432863848807889483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/432863848807889483'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/10/aprendendo-assembly-parte-1.html' title='Aprendendo Assembly - Parte 1'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd-BSUHjy8Rt4jgaTkB4XyG1SmbOPQW56Hp5zVqv_UP75WC-79vym647CL_ZpDsCNvRjU_7a5dksI3HYFNh_cKv9BLj2SEWfKZlxpvUvOd3bq34tQTj0MPie9i5B1HM5t5zkpLzdYD1wxL/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-2465999072010749225</id><published>2012-10-21T16:58:00.001-07:00</published><updated>2012-10-21T17:00:26.710-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Notícias"/><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio"/><title type='text'>Disponível Visual Studio 2012 Express Edition</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRonBwL7eWUxWR3LCxLinaJH_XekR99gXB6xEbKdBboBUL987Ayew&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRonBwL7eWUxWR3LCxLinaJH_XekR99gXB6xEbKdBboBUL987Ayew&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Já está disponível o download do Visual Studio 2012 Express Edition, contendo novos recursos e possibilitando o desenvolvimento de aplicativos na interface Metro para Windows 8.&lt;br /&gt;
Você pode conferir todas as novidades em: &lt;a href=&quot;http://www.microsoft.com/visualstudio/ptb/whats-new&quot;&gt;http://www.microsoft.com/visualstudio/ptb/whats-new&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
E pode fazer o download da versão Express em &lt;a href=&quot;http://www.microsoft.com/visualstudio/ptb/downloads&quot;&gt;http://www.microsoft.com/visualstudio/ptb/downloads &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Uma das novidades vista já de cara, [e que agora os downloads estão separados por&lt;br /&gt;
plataforma.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiavaRP3UUjp34eL1KneEe11tiiTGhPRQvaBZXgUYmYmlNNma9jE9crrNUdQr3vF_L2I9F8ij-p0ODTP1E5mAwe0__bm6MiQ5BcMGW5RtZyISOXGeJVDYvps1EmlQBJ1nfSjROL7FR-5rnL/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiavaRP3UUjp34eL1KneEe11tiiTGhPRQvaBZXgUYmYmlNNma9jE9crrNUdQr3vF_L2I9F8ij-p0ODTP1E5mAwe0__bm6MiQ5BcMGW5RtZyISOXGeJVDYvps1EmlQBJ1nfSjROL7FR-5rnL/s640/6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/2465999072010749225/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/10/disponivel-visual-studio-2012-express.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/2465999072010749225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/2465999072010749225'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/10/disponivel-visual-studio-2012-express.html' title='Disponível Visual Studio 2012 Express Edition'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiavaRP3UUjp34eL1KneEe11tiiTGhPRQvaBZXgUYmYmlNNma9jE9crrNUdQr3vF_L2I9F8ij-p0ODTP1E5mAwe0__bm6MiQ5BcMGW5RtZyISOXGeJVDYvps1EmlQBJ1nfSjROL7FR-5rnL/s72-c/6.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-4412840186090829438</id><published>2012-10-21T16:29:00.002-07:00</published><updated>2012-10-21T16:29:36.144-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Banco de Dados"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><title type='text'>Trabalhando com datas - MySQL</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Neste post estarei mostrando como é possível manipular datas no banco de dados, utilizando apenas algumas das funções disponíveis.&lt;/div&gt;
Primeiramente, vamos criar um novo banco de dados.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE DATABASE teste_data;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos nos conectar ao banco.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;USE teste_data;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
E criar uma tabela para que podemos com os campos necessários.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;CREATE TABLE clientes (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;nome VARCHAR(30),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;endereco VARCHAR(30),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;telefone VARCHAR(15),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;data_nasc DATE);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Para podemos manipular esta tabela, vamos inserir alguns registros.&lt;br /&gt;
&lt;br /&gt;
Vale lembrar que no MySQL as datas são representadas como: YYYY-MM-DD.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Para inserir os dados no MySQL, &lt;b&gt;não&lt;/b&gt; devemos usar nada (traço, barra, underline) para separar o ano do mês e o mês do dia.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Data: 10/02/1990:&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INSERT INTO clientes VALUES (null, &quot;Joaozinho&quot;, &quot;Rua AAA&quot;, &quot;5555-5555&quot;, 19900210);&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;Data: 30/10/1994&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INSERT INTO clientes VALUES (null, &quot;Maria&quot;, &quot;Rua BBB&quot;, &quot;3333-3333&quot;, 19941030);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Data: 22/05/1985&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INSERT INTO clientes VALUES (null, &quot;Pedrinho&quot;, &quot;Rua CCC&quot;, &quot;9999-9999&quot;, 19850522);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Usando a Data Atual&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Já pensou ter que ficar digitando a data atual toda hora ao inserir em algum registro que precise usar a data de hoje?&lt;br /&gt;
O MySQL possui um comando chamado &lt;b&gt;CURDATE()&lt;/b&gt;&amp;nbsp;ou também &lt;i&gt;Current Date&lt;/i&gt;&amp;nbsp;que chama a data atual.&lt;br /&gt;
&lt;br /&gt;
Digamos que o &quot;José&quot; nasceu no dia de hoje.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INSERT INTO clientes VALUES (null, &quot;Jose&quot;, &quot;Rua DDD&quot;, &quot;1111-1111&quot;, CURDATE());&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Obs: O &lt;i&gt;CurDate() &lt;/i&gt;retorna tanto a data atual quanto a hora atual. Pode-se usar para retornar apenas a data o comando &lt;i&gt;Now().&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsU20omSifCQp6HPSIM0o5wdmqQ_bBiv5sD6JuycFkCS9UzaRTOqHWxfRqsICjgpTbKKPwoJX3TwvkjFAx_Lo7bJ5iu-ScShvL-3l6d4xmPMckGcdfUhLhcXJ53LLoaGGrORH9AybZ-cWZ/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsU20omSifCQp6HPSIM0o5wdmqQ_bBiv5sD6JuycFkCS9UzaRTOqHWxfRqsICjgpTbKKPwoJX3TwvkjFAx_Lo7bJ5iu-ScShvL-3l6d4xmPMckGcdfUhLhcXJ53LLoaGGrORH9AybZ-cWZ/s400/2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;b&gt;Extraindo Ano, Mês ou Dia&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
É interessante usar o &lt;i&gt;Extract&lt;/i&gt;&amp;nbsp;quando precisamos pegar apenas o ano ou o mês (ou dia) de algum registro.&lt;br /&gt;
Por exemplo: Queremos ver apenas os clientes nascidos em 1994.&lt;br /&gt;
&lt;br /&gt;
Vou inserir mais um registro nascido em 1994.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;Data: 01/02/1994&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;INSERT INTO clientes VALUES (null, &quot;Joaquim&quot;, &quot;Rua EEE&quot;, &quot;3333-3333&quot;, 19940203);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Sintaxe:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;EXTRACT(#tipo# FROM #campo_data#)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Onde #tipo# = YEAR, MONTH ou DAY.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Agora vamos selecioná-los:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT * FROM clientes WHERE EXTRACT(YEAR FROM data_nasc) = &#39;1994&#39;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A mesma coisa funciona para meses e dias, use &lt;i&gt;MONTH &lt;/i&gt;para meses e &lt;i&gt;DAY&lt;/i&gt;&amp;nbsp;para dias.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeaCjQfFQSSzIYC25NHCxBtQezKRwoI5CzmAet7RLX64NraYabp_jiLKe6EsgGVWINPxjEJQiCEbOrD4WAGuqdSOs50NUjkBGx0CUpUqsG5gMdKnTWD_SDyqmkuu34OR6hIpn07mVfuaCL/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeaCjQfFQSSzIYC25NHCxBtQezKRwoI5CzmAet7RLX64NraYabp_jiLKe6EsgGVWINPxjEJQiCEbOrD4WAGuqdSOs50NUjkBGx0CUpUqsG5gMdKnTWD_SDyqmkuu34OR6hIpn07mVfuaCL/s400/3.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Retornando a diferença de dias entre duas datas.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Sintaxe:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;DATEDIFF(#data1#, #data2#);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Quantidade de dias entre 21-10-2012 [HOJE] e 2012-10-23 [Daqui a dois dias]&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT DATEDIFF(&#39;2012-10-23&#39;,&#39;2012-10-21&#39;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Subtraindo/Adicionando Dias, Meses e Anos&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Usamos o &lt;i&gt;DATE_SUB()&lt;/i&gt;&amp;nbsp;quando precisamos retornar valores de dias atrás, por exemplo: vamos subtrair 5 dias de cada data.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Sintaxe:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT #campo1#, #campo2#, #campoN# DATE_SUB(#campo_data#, INTERVAL #N# #tipo#) FROM #tabela#;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Onde #tipo# = YEAR, DAY ou MONTH.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT nome, DATE_SUB(data_nasc, INTERVAL 5 DAY) FROM clientes;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Neste caso, serão subtraídos 5 dias da data dos registros. Podemos somar valores utilizando &lt;i&gt;DATE_ADD().&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT nome, DATE_ADD(data_nasc, INTERVAL 5 DAY) FROM clientes;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK3GIRXy9QuunjlNS7fVE98wGMrZWPVTHbTX1dxKl1Nly9bYeiFBIWFcydfsKwkKpdVWPI8fhoANR041snBheoIh8DHdJd1tPsW18pZIcEFbIgxhZShmJxG8JSLgJn5g3i-OwWDzWyfqBo/s1600/5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK3GIRXy9QuunjlNS7fVE98wGMrZWPVTHbTX1dxKl1Nly9bYeiFBIWFcydfsKwkKpdVWPI8fhoANR041snBheoIh8DHdJd1tPsW18pZIcEFbIgxhZShmJxG8JSLgJn5g3i-OwWDzWyfqBo/s400/5.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;É isso aí, essas são algumas das básicas funções de manipulação de datas do MySQL.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraços e até a próxima.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/4412840186090829438/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/10/trabalhando-com-datas-mysql.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/4412840186090829438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/4412840186090829438'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/10/trabalhando-com-datas-mysql.html' title='Trabalhando com datas - MySQL'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsU20omSifCQp6HPSIM0o5wdmqQ_bBiv5sD6JuycFkCS9UzaRTOqHWxfRqsICjgpTbKKPwoJX3TwvkjFAx_Lo7bJ5iu-ScShvL-3l6d4xmPMckGcdfUhLhcXJ53LLoaGGrORH9AybZ-cWZ/s72-c/2.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-812786163283932410</id><published>2012-10-15T09:11:00.001-07:00</published><updated>2012-10-15T09:11:08.735-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Metropolis"/><category scheme="http://www.blogger.com/atom/ns#" term="XE3"/><title type='text'>VCL Metropolis UI App - Delphi XE3</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Nesta nova versão do Delphi, temos a possibilidade de desenvolver aplicativos com a interface Metro utilizando o VCL Metropolis UI Application.&lt;br /&gt;
&lt;br /&gt;
Logo ao criar uma nova aplicação, temos alguns templates disponíveis como:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Blank Metropolis UI Application&lt;/b&gt; -&amp;gt; Cria uma nova aplicação em branco&lt;br /&gt;
&lt;b&gt;Grid Metropolis UI Application&lt;/b&gt; -&amp;gt;&lt;br /&gt;
&lt;b&gt;Split Pane Metropolis UI Application&lt;/b&gt; -&amp;gt; Template com barra de subitens laterais.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnoIiTM8XvxaLWu9F-BywyfvqAZyjEB8y04sWkAhVK6AVjz-ezd6eqASFD5SYS1A3kIauYUJ0chyTJPyqSI5Gr4FYmPGYlIrFxRSmJuy87g61A3KCCxJHlqxvieTZla_oEu3v5ZMcoE_Fj/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;297&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnoIiTM8XvxaLWu9F-BywyfvqAZyjEB8y04sWkAhVK6AVjz-ezd6eqASFD5SYS1A3kIauYUJ0chyTJPyqSI5Gr4FYmPGYlIrFxRSmJuy87g61A3KCCxJHlqxvieTZla_oEu3v5ZMcoE_Fj/s400/1.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Podemos perceber o visual simples e sem os efeitos da interface Metro, porém, os aplicativos ficam bem mais &quot;atraentes&quot;, sendo executados no Windows 8.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrXaTNO5px8eIVLR9LS1CUcKAgqLqtz1_5cUGDhjwsWrimNoS2Mz7Bmu7DW551iXA9FKReBebILm5IZ1acsTqf9bnl4bT2kJQBlIfc9ccUKD2UAfBT_tVg_5g8KaH0Dz2zP62w2tR4amvO/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;241&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrXaTNO5px8eIVLR9LS1CUcKAgqLqtz1_5cUGDhjwsWrimNoS2Mz7Bmu7DW551iXA9FKReBebILm5IZ1acsTqf9bnl4bT2kJQBlIfc9ccUKD2UAfBT_tVg_5g8KaH0Dz2zP62w2tR4amvO/s400/2.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b style=&quot;text-align: start;&quot;&gt;Split Pane Metropolis UI Application&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b style=&quot;text-align: start;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqa8sYjuSFAa71rgX5GTdnqyCj4I9qBBOpKFaJLz_5f6kxg7dVfXQQArEuVZI3KV4ruZWP0DXYjJOzjM7ZwbcKKFSWiFODkOozy1g_PG8VYyRiDDpxC_MR6iih4iLv4A0CRLwHKedf7tnX/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqa8sYjuSFAa71rgX5GTdnqyCj4I9qBBOpKFaJLz_5f6kxg7dVfXQQArEuVZI3KV4ruZWP0DXYjJOzjM7ZwbcKKFSWiFODkOozy1g_PG8VYyRiDDpxC_MR6iih4iLv4A0CRLwHKedf7tnX/s400/3.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;Grid Metropolis UI Application&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Como trata-se de um Template, podemos perceber também que ao pressionar &quot;Esc&quot;, é exibido um TImage no canto inferior direito da tela, possibilitando fechar a aplicação.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8qxQNf88VJmOeNwPLJhSJP40LNQbrM-NYT23NjWU1L5Q2wNh0qM9gNZJ7zm1y4tO-V6LP7bRP11yNYhzIgWG-5rmINM4iMzl7qzieddQCEM3lbSfdBrV7EVt8hWg2ofvUi0WkUcZEq6ki/s1600/4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8qxQNf88VJmOeNwPLJhSJP40LNQbrM-NYT23NjWU1L5Q2wNh0qM9gNZJ7zm1y4tO-V6LP7bRP11yNYhzIgWG-5rmINM4iMzl7qzieddQCEM3lbSfdBrV7EVt8hWg2ofvUi0WkUcZEq6ki/s1600/4.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
E aí, o que você achou da nova interface?&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Vai desenvolver para a interface Metro?&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
Abraço e até a próxima.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.cursos24h.net.br/banners/areas/informatica/gif/468x60.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cursos Online na Área de Informática&quot; border=&quot;0&quot; src=&quot;http://www.cursos24h.net.br/banners/areas/informatica/gif/468x60.gif&quot; style=&quot;border: none; color: #0000ee; text-align: center;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/812786163283932410/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/10/vcl-metropolis-ui-app-delphi-xe3.html#comment-form' title='4 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/812786163283932410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/812786163283932410'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/10/vcl-metropolis-ui-app-delphi-xe3.html' title='VCL Metropolis UI App - Delphi XE3'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnoIiTM8XvxaLWu9F-BywyfvqAZyjEB8y04sWkAhVK6AVjz-ezd6eqASFD5SYS1A3kIauYUJ0chyTJPyqSI5Gr4FYmPGYlIrFxRSmJuy87g61A3KCCxJHlqxvieTZla_oEu3v5ZMcoE_Fj/s72-c/1.PNG" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-552234103676946161</id><published>2012-09-04T13:29:00.002-07:00</published><updated>2012-09-04T13:29:10.917-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Rad Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="XE3"/><title type='text'>Rad Studio XE3 Trial</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcR5_bDBVMyRQniqik4YZK_J9A0Ejm1VHv1x8ziCZ5ue8KsOaowqzw&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcR5_bDBVMyRQniqik4YZK_J9A0Ejm1VHv1x8ziCZ5ue8KsOaowqzw&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Está disponível o Trial do Rad Studio XE3 com:&lt;br /&gt;
&lt;br /&gt;
-Delphi&lt;br /&gt;
-C++ Builder&lt;br /&gt;
-Prism&lt;br /&gt;
-HTML5 Builder&lt;br /&gt;
-Interbase&lt;br /&gt;
&lt;br /&gt;
Você pode fazer o download em:&amp;nbsp;&lt;a href=&quot;http://www.embarcadero.com/products/rad-studio/downloads&quot;&gt;http://www.embarcadero.com/products/rad-studio/downloads&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/552234103676946161/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/09/rad-studio-xe3-trial.html#comment-form' title='183 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/552234103676946161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/552234103676946161'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/09/rad-studio-xe3-trial.html' title='Rad Studio XE3 Trial'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>183</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-3194153110581595988</id><published>2012-09-04T13:29:00.001-07:00</published><updated>2012-09-04T13:29:05.206-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Gravar registros no Regedit - Delphi</title><content type='html'>&lt;div&gt;
O Regedit é um &quot;banco de dados&quot; onde são armazenadas configurações de programas instalados, diretórios, &amp;nbsp;arquivos e configurações do Windows.&lt;/div&gt;
&lt;div&gt;
Neste post demonstrarei como gravar um registro simples no Regedit através do Delphi.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A primeira coisa a se fazer, é adicionar a &lt;i&gt;uses &lt;/i&gt;&lt;b&gt;Registry.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Os seguintes diretórios, são diretórios do Regedit e precisamos informar em qual delas nosso registro será gravado.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXg5UHJCoVOGWaKpxB2ZNeQFEVIid4SqmRKu7QSdp23vOjdFpitZZbECT65M0HpohwmaBiZMPx19OmPbNMC6s8JUORqmMp5lBxbHTg7NXwlcyvXPARZgrr9Op90zfagHs-DApsSy2Qtwt8/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXg5UHJCoVOGWaKpxB2ZNeQFEVIid4SqmRKu7QSdp23vOjdFpitZZbECT65M0HpohwmaBiZMPx19OmPbNMC6s8JUORqmMp5lBxbHTg7NXwlcyvXPARZgrr9Op90zfagHs-DApsSy2Qtwt8/s1600/1.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para podermos manipular o registro, vamos ter que declarar uma variável do tipo &lt;i&gt;TRegistry.&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;var&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro : TRegistry;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ao iniciar o nosso código, devemos criar uma nova instância do registro.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro := TRegistry.Create;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
O seguinte código efetua a gravação no registro:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;registro.RootKey := HKEY_CURRENT_USER;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;registro.OpenKey(&lt;span style=&quot;color: purple;&quot;&gt;&#39;MeusRegistros&#39;&lt;/span&gt;,&lt;span style=&quot;color: purple;&quot;&gt;True&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;registro.WriteString(&#39;&lt;span style=&quot;color: blue;&quot;&gt;MeuPrimeiroRegistro&#39;&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;&#39;Valor do Registro&#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A primeira linha informa o diretório de registros.&lt;/div&gt;
&lt;div&gt;
A segunda linha, faz a criação de um novo diretório dentro da &lt;i&gt;RootKey&lt;/i&gt;.&lt;/div&gt;
&lt;div&gt;
Os parâmetros do comando &lt;i&gt;WriteString&lt;/i&gt;, fazem a criação do registro e o valor do registro respectivamente.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiatJTFvPqLd1d-Mjv75Y8oXiWAUbei1ysdSde0UHz1dYXUX9awVFd-RPfPRAkhFw10ulbPFdlIiOLTUhnt_b1OBUm48j0svBs6Mtw1deOn0Jxb-E6pAU4ffKVnDG5sH8bfMThe4q5Wh-Cf/s1600/Capturar.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiatJTFvPqLd1d-Mjv75Y8oXiWAUbei1ysdSde0UHz1dYXUX9awVFd-RPfPRAkhFw10ulbPFdlIiOLTUhnt_b1OBUm48j0svBs6Mtw1deOn0Jxb-E6pAU4ffKVnDG5sH8bfMThe4q5Wh-Cf/s640/Capturar.PNG&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Da mesma forma que abrimos a chave de registro com &lt;i&gt;OpenKey()&lt;/i&gt;, devemos fecha-la.&lt;br /&gt;
O código inteiro fica da seguinte maneira:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;var&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro : TRegistry;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro := TRegistry.Create;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro.RootKey := HKEY_CURRENT_USER;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro.OpenKey(&lt;span style=&quot;color: purple;&quot;&gt;&#39;MeusRegistros&#39;&lt;/span&gt;,&lt;span style=&quot;color: purple;&quot;&gt;True&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro.WriteString(&#39;&lt;span style=&quot;color: blue;&quot;&gt;MeuPrimeiroRegistro&#39;&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;&#39;Valor do Registro&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; registro.CloseKey;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;end;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraços e até a próxima.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-programacao-e-desenvolvimento.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;60&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-programacao-e-desenvolvimento.gif&quot; style=&quot;color: #0000ee; text-align: center;&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/3194153110581595988/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/09/gravar-registros-no-regedit-delphi.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3194153110581595988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3194153110581595988'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/09/gravar-registros-no-regedit-delphi.html' title='Gravar registros no Regedit - Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXg5UHJCoVOGWaKpxB2ZNeQFEVIid4SqmRKu7QSdp23vOjdFpitZZbECT65M0HpohwmaBiZMPx19OmPbNMC6s8JUORqmMp5lBxbHTg7NXwlcyvXPARZgrr9Op90zfagHs-DApsSy2Qtwt8/s72-c/1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-1632394950041451488</id><published>2012-09-04T13:29:00.000-07:00</published><updated>2012-09-04T13:29:00.677-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Estruturas de Repetição - Delphi</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;
Estruturas de repetição (loop ou laços) são essenciais e resolvem diversos problemas e situações em que necessitamos repetir alguma estrutura ou um bloco de código.&lt;/div&gt;
Dentre essas estruturas, temos o laço &lt;b&gt;For&lt;/b&gt;, &lt;b&gt;For-DownTo, For-in,&amp;nbsp;While &lt;/b&gt;e o &lt;b&gt;Repeat-until.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;-For&lt;/b&gt;&lt;br /&gt;
É nós quem determinamos o número de vezes que a repetição acontecerá. Sua estrutura é a seguinte:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;for &lt;/b&gt;#contador# := #valorInicial#&amp;nbsp;&lt;b&gt;to #&lt;/b&gt;valorFinal#&amp;nbsp;&lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #faça_alguma_coisa#&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
O contador é um número inteiro, uma variável que será usada para proceder com a próxima contagem do loop.&lt;br /&gt;
Por exemlplo:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;for&amp;nbsp;&lt;/b&gt;i := 1&amp;nbsp;&lt;b&gt;to&amp;nbsp;&lt;/b&gt;10&amp;nbsp;&lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;O valor de i é &#39;&lt;/span&gt; + IntToStr(i));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Nesse caso, será mostrado uma mensagem contendo o valor de &lt;b&gt;i&lt;/b&gt;&amp;nbsp;de 1 até 10.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;O valor de i é 1&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;O valor de i é 2&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;O valor de i é 3&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;...&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;O valor de i é 10&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;b&gt;-For-downto&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A diferença do laço for-downto é que ao invés de incrementar o contador, ele decrementa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;for&amp;nbsp;&lt;/b&gt;i := 10 &lt;b&gt;downto&amp;nbsp;&lt;/b&gt;10&amp;nbsp;&lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;O valor de i é &#39;&lt;/span&gt;&amp;nbsp;+ IntToStr(i));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;O valor de i é 10&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;O valor de i é 9&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;O valor de i é 8&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;...&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;O valor de i é 1&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;-&lt;/i&gt;&lt;b&gt;For-in&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
O for-in nos permite trabalhar com cada elemento de uma coleção, por exemplo, cada letra de uma palavra.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;var&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Nome: &lt;b&gt;string;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&amp;nbsp; &lt;/b&gt;letra: char;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Nome := &lt;span style=&quot;color: blue;&quot;&gt;&#39;Cristiano&#39;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;for&amp;nbsp;&lt;/b&gt;letra &lt;b&gt;in &lt;/b&gt;Nome&amp;nbsp;&lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ShowMessage(letra);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;end;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Nesse caso, será mostrado uma mensagem com cada letra da variável &lt;i&gt;Nome.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
-&lt;b&gt;While&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Esse laço só continua repetindo enquanto a condição for verdadeira. Por exemplo, só executa enquanto a variável &lt;i&gt;i &lt;/i&gt;for menor que 10.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;i:=&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;while&amp;nbsp;&lt;/b&gt;i &amp;lt; &lt;span style=&quot;color: blue;&quot;&gt;10&lt;/span&gt; &lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ShowMessage(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;O valor de i é &#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;+ IntToStr(i)&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;i := i + 1; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// agora i é igual a 2&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;end;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
Neste caso, o código só será executado enquanto i for menor que 10. No caso acrescentamos 1 a &lt;b&gt;i&lt;/b&gt;&amp;nbsp;para que continue sendo executado.&lt;br /&gt;
Na próxima vez que for executado, &lt;b&gt;i &lt;/b&gt;vai ter o valor de 2, então ainda vai continuar sendo executado pois a instrução é verdadeira até que seja menor que 10.&lt;br /&gt;
Na terceira vez, &lt;b&gt;i &lt;/b&gt;vai valer 3, e assim consecutivamente.&lt;br /&gt;
&lt;br /&gt;
-&lt;b&gt;Repeat&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Similar ao &lt;i&gt;While&lt;/i&gt;, porém a estrutura é ao contrário. Ele executa e depois verifica a instrução.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;i:=&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;repeat&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ShowMessage(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&#39;O valor de i é &#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;+ IntToStr(i)&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;i := i + 1; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// agora i é igual a 2&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;until &lt;/b&gt;i &amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;10&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;end;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Neste caso, o código é executado até que i seja maior que 10.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraço e até a próxima.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.cursos24h.net.br/banners/areas/informatica/gif/468x60.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Cursos Online na Área de Informática&quot; border=&quot;0&quot; src=&quot;http://www.cursos24h.net.br/banners/areas/informatica/gif/468x60.gif&quot; style=&quot;border: none; color: #0000ee; text-align: center;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/1632394950041451488/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/09/estruturas-de-repeticao-delphi.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1632394950041451488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1632394950041451488'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/09/estruturas-de-repeticao-delphi.html' title='Estruturas de Repetição - Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-8252942795507989927</id><published>2012-09-02T15:30:00.002-07:00</published><updated>2012-09-02T15:43:53.890-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Notícias"/><title type='text'>Rad Studio XE3 Preview</title><content type='html'>&lt;center style=&quot;text-align: left;&quot;&gt;
Está disponível a página do Preview do Rad Studio XE3.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
Entre as novidades está o desenvolvimento para aplicações Metro do Windows 8, uma nova versão do FireMonkey possibilitando o desenvolvimento para Windows 8 e Mac OS X Mountain Lion, e o HTML5 Builder.&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
Veja a página original em&amp;nbsp;&lt;a href=&quot;http://www.embarcadero.com/rad-xe3-preview&quot;&gt;http://www.embarcadero.com/rad-xe3-preview&lt;/a&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;/center&gt;
&lt;center style=&quot;text-align: left;&quot;&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;360&quot; src=&quot;http://www.youtube.com/embed/OZweoTDTP2M&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;center&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;center&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;center&gt;
&lt;a href=&quot;http://www.iped.com.br/3d-e-games/afiliado/838361&quot;&gt;&lt;img height=&quot;73&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-3d-e-games.gif&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;/center&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/8252942795507989927/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/09/rad-studio-xe3-preview.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/8252942795507989927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/8252942795507989927'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/09/rad-studio-xe3-preview.html' title='Rad Studio XE3 Preview'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/OZweoTDTP2M/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-7258368698916754858</id><published>2012-09-02T15:30:00.001-07:00</published><updated>2012-09-02T15:38:14.743-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Criando um Editor Pascal em Delphi</title><content type='html'>E ai galera blz?&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hoje vou mostrar um tutorial muito legal, uma dica bem interessante para estudar.&lt;/div&gt;
&lt;div&gt;
Os procedimentos são bem simples e vou mostrar tudo o que vamos utilizar, vamos lá!&lt;br /&gt;
&lt;br /&gt;
Funções do nosso editor:&lt;br /&gt;
&lt;br /&gt;
-Sintaxe Pascal&lt;br /&gt;
-Abrir e Salvar arquivos .pas&lt;br /&gt;
-Compilar&lt;br /&gt;
&lt;br /&gt;
Para compilar vamos usar o próprio compilador do Delphi. O DCC32.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
- &lt;i&gt;&lt;b&gt;FastScript&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
Componente necessário para utilizarmos a sintaxe do Pascal dentro de nossa aplicação.&lt;/div&gt;
&lt;div&gt;
Obs. O &lt;b&gt;Delphi XE2 Update 4 &lt;/b&gt;já possui esse componente instalado.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Download em&amp;nbsp;&lt;a href=&quot;http://www.fast-report.com/en/download/fast-script-download.html&quot;&gt;http://www.fast-report.com/en/download/fast-script-download.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
O componente &lt;i&gt;FastScript&lt;/i&gt;&amp;nbsp;possui componentes muito legais que possuem a execução de um código e sintaxe para várias linguagens, mas só usaremos um desses componentes, o &lt;i&gt;TfsSyntaxMemo.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Vamos montar nosso form.
&lt;br /&gt;
Instale o &lt;i&gt;FastScript &lt;/i&gt;de acordo com sua versão do Delphi, ou se estiver usando o Delphi XE2 adicione-o ao seu form o componente &lt;i&gt;TfsSyntaxMemo.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Y_9v7ZY5xlBMVmO5twWhB_P50eliiJnFfrSq6wPJGy5fVyGjWsWvhmI4Ow0gS_DblITepkghc1hyphenhyphenVzOIxOOqusPpqvAp4E9ZOxhafCUHx3PvSIN2Ng_vza3G_D-j1QuhYlCLY8v8aRmR/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Y_9v7ZY5xlBMVmO5twWhB_P50eliiJnFfrSq6wPJGy5fVyGjWsWvhmI4Ow0gS_DblITepkghc1hyphenhyphenVzOIxOOqusPpqvAp4E9ZOxhafCUHx3PvSIN2Ng_vza3G_D-j1QuhYlCLY8v8aRmR/s1600/2.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Mude as propriedades dele para:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Align: &lt;/b&gt;alClient&lt;br /&gt;
&lt;b&gt;Name: &lt;/b&gt;Editor&lt;br /&gt;
&lt;b&gt;SyntaxType: &lt;/b&gt;stPascal&lt;br /&gt;
&lt;br /&gt;
Feito isso, vamos adicionar uma &lt;i&gt;TToolbar &lt;/i&gt;que fica na paleta &lt;i&gt;Win32&lt;/i&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmA9IjRYzO86LAcMV_R9XUHCX7cnyE_PqVO_HYo7nVSAdlV7V2JrHxxFf0s1vEgIiKnAz67tjl1ydMSsNpkWP4_N4Dileoo-Cg5MmjAgRBzKGrEozhN9sNxjNo-Sr4m3ym51SH_U9WppAn/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmA9IjRYzO86LAcMV_R9XUHCX7cnyE_PqVO_HYo7nVSAdlV7V2JrHxxFf0s1vEgIiKnAz67tjl1ydMSsNpkWP4_N4Dileoo-Cg5MmjAgRBzKGrEozhN9sNxjNo-Sr4m3ym51SH_U9WppAn/s1600/3.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Agora vamos adicionar os botões na &lt;i&gt;Toolbar&lt;/i&gt;. Clique com o botão direito e clique &lt;i&gt;Add New Button.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcNhcg0P9R2x0eTxgW64NxAJLBqGZ6sbLLy5Qy-7zic_No8-iM_-GuVwI7TkKjtnlDUbo4ce8lR1NBF92RL-5U6W4b5LWjWpgr9ruFDj4kU8ENPZqyZq5Eup96YZRKJ_lcLCyCIzszJlGQ/s1600/4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcNhcg0P9R2x0eTxgW64NxAJLBqGZ6sbLLy5Qy-7zic_No8-iM_-GuVwI7TkKjtnlDUbo4ce8lR1NBF92RL-5U6W4b5LWjWpgr9ruFDj4kU8ENPZqyZq5Eup96YZRKJ_lcLCyCIzszJlGQ/s1600/4.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Adicione um &lt;i&gt;ImageList&lt;/i&gt;, dê um duplo clique nele e adicione as imagens dos nossos botões.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM5eMQma4EqkavyROvt_K2_8h7gKKW_7ecvIbZNfzFks5EssMFISegTFKInijk202WH-B6dwwFFgcALEwWVukqG4ooM4XFJcdKjDueqzvy2HVOiargAGSSg81wK9wrCAJfEPPm5vgaX-3t/s1600/6.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM5eMQma4EqkavyROvt_K2_8h7gKKW_7ecvIbZNfzFks5EssMFISegTFKInijk202WH-B6dwwFFgcALEwWVukqG4ooM4XFJcdKjDueqzvy2HVOiargAGSSg81wK9wrCAJfEPPm5vgaX-3t/s400/6.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Eu utilizei os ícones &lt;i&gt;Gentlefae&amp;nbsp;Free Toolbar Icons&lt;/i&gt;, você pode baixá-los em&amp;nbsp;&lt;a href=&quot;http://www.gentleface.com/free_toolbar_icons.html&quot;&gt;http://www.gentleface.com/free_toolbar_icons.html&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Basta associarmos a propriedade &lt;i&gt;Images &lt;/i&gt;da Toolbar com &lt;i&gt;ImageLis1&lt;/i&gt;&amp;nbsp;que acabamos de adicionar&lt;i&gt;&amp;nbsp;&lt;/i&gt;e ligar as propriedades &lt;i&gt;ImageIndex&lt;/i&gt;&amp;nbsp;de cada botão com a respectiva imagem.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Nosso design está pronto!&lt;br /&gt;
&lt;br /&gt;
Agora, vamos declarar uma variável pública para verificar se o arquivo já está salvo ou não, e uma para armazenar o local onde o arquivo está salvo.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;public&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; salvo: boolean;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; local: &lt;span style=&quot;color: purple;&quot;&gt;string&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
E vamos criar uma procedure para salvar os arquivos.&lt;br /&gt;
Antes de mais nada, adicione um &lt;i&gt;SaveDialog&lt;/i&gt;&amp;nbsp;que está na paleta &lt;i&gt;Dialogs.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.SalvarArquivo;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; local = &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// se nao tiver salvo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; SaveDialog1.Execute(); &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// executa o Dialog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; SaveDialog1.FileName &amp;lt;&amp;gt; &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Editor.Lines.SaveToFile(SaveDialog1.FileName + &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;.pas&#39;&lt;/span&gt;); &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// salva onde foi selecionado&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; local := SaveDialog1.FileName; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// guarda o local onde foi salvo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; salvo := &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;true&lt;/span&gt;; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// já está salvo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;else&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// se ja tiver salvo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Editor.Lines.SaveToFile(local + &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;.pas&#39;&lt;/span&gt;); &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// salva em cima&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; salvo := &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;true&lt;/span&gt;; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// já está salvo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
----------------------
&lt;br /&gt;
&lt;br /&gt;
Vamos ao código do botão 1, que é o botão &#39;Novo&#39;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.ToolButton1Click(Sender: TObject);&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; salvo = &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;false&lt;/span&gt; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// pergunta se deseja salvar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; MessageDlg(&lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;Deseja Salvar o arquivo?&#39;&lt;/span&gt;, mtConfirmation, [mbYes, mbNo], 0) = mrYes &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SalvarArquivo; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// chama a procedure para salvar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;else&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// se já está salvo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Editor.Lines.Clear; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// apaga as linhas do Editor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; salvo := &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
----------------------
&lt;br /&gt;
&lt;br /&gt;
Código do botão 1, botão &#39;Abrir&#39;.&lt;br /&gt;
Antes, adicione um &lt;i&gt;OpenDialog&lt;/i&gt;&amp;nbsp;que se encontra na paleta &lt;i&gt;Dialogs.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.ToolButton2Click(Sender: TObject);&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; salvo = &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;false&lt;/span&gt; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// pergunta se deseja salvar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; MessageDlg(&lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;Deseja Salvar o arquivo antes de abrir outro?&#39;&lt;/span&gt;, mtConfirmation, [mbYes, mbNo], 0) = mrYes &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SalvarArquivo; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// chama a procedure para salvar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; OpenDialog1.Execute(); &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// chama o dialog&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;if&lt;/span&gt; OpenDialog1.FileName &amp;lt;&amp;gt; &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;&#39;&lt;/span&gt; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Editor.Lines.LoadFromFile(OpenDialog1.FileName); &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// carrega o arquivo selecionado&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; local := OpenDialog1.FileName; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// guarda local&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
----------------------
&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Código do botão 3. Salvar.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.ToolButton3Click(Sender: TObject);&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; SalvarArquivo; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// chama a procedure para salvar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
----------------------&lt;br /&gt;
&lt;br /&gt;
Código do botão 4. Executar.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;procedure&lt;/span&gt; TForm1.ToolButton4Click(Sender: TObject);&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; arquivo: &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;string&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; arquivo := local + &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;.exe&#39;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; WinExec(&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;PAnsiChar&lt;/span&gt;(arquivo), SW_NORMAL) &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// executa o arquivo compilado&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
--------------------&lt;br /&gt;
&lt;br /&gt;
Código do botão 5. Compilar.&lt;br /&gt;
&lt;br /&gt;
Chegamos na hora mais esperada!&lt;br /&gt;
Como falei no começo do post, vamos utilizar o próprio compilador do Delphi, localizado normalmente em&amp;nbsp;&lt;i&gt;C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin\dcc32.exe&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
É ele que vamos chamar para compilar o arquivo. Adicione um &lt;i&gt;TMemo &lt;/i&gt;localizado na paleta &lt;i&gt;Additional &lt;/i&gt;e marque a propriedade &lt;i&gt;visible&lt;/i&gt;&amp;nbsp;para &lt;i&gt;false.&lt;/i&gt;&lt;br /&gt;
Mãos a obra!!!&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #7f0055; font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: bold;&quot;&gt;procedure&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; TForm1.ToolButton5Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; localCompilador, comando: &lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;string&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #7f0055; font-family: Courier New, Courier, monospace; font-weight: bold;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; SalvarArquivo; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #3f7f59;&quot;&gt;// é necessario salvar antes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// altere o local do compilador se necessário&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; localCompilador := &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;&quot;C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin\dcc32.exe&quot;&#39;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; comando := localCompilador + &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39; &quot;&#39;&lt;/span&gt; + local + &lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;.pas&quot;&#39;&lt;/span&gt;; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// linha de comando do compilador&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Memo1.Lines.Add(comando);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Memo1.Lines.Add(&lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;PAUSE&#39;&lt;/span&gt;); &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// comando do DOS para pausar a execução do batch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Memo1.Lines.SaveToFile(&lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;compilar.bat&#39;&lt;/span&gt;); &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// salva o arquivo com a linha de comando&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; WinExec(&lt;span style=&quot;color: #2a00ff;&quot;&gt;&#39;compilar.bat&#39;&lt;/span&gt;, SW_NORMAL); &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3f7f59;&quot;&gt;// executa a linha de comando.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Repare a linha &amp;nbsp;em que salvamos o arquivo &lt;i&gt;compilar.bat&lt;/i&gt;.&lt;br /&gt;
Gravamos nesse arquivo a linha de comando necessária para compilar o arquivo salvo.&lt;br /&gt;
Caso o programa já esteja salvo, é esse linha que ele irá gerar:&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;&quot;C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin&quot; &quot;c:\arquivo.pas&quot;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Após salvar o arquivo, executamos ele, e ele compila o arquivo.&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Lembrando que estamos usando o compilar da Embarcadero®, então temos que incluir todos os parâmetros que o compilador precisa, por exemplo, para criar uma aplicação em nosso editor e compilarmos, temos que adicionar a diretiva&amp;nbsp;&lt;b&gt;{$APPTYPE CONSOLE}. &lt;/b&gt;exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;program teste;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{$APPTYPE CONSOLE}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;end.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Bom galera, é isso aí, um bom projeto para se estudar.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Você pode pegar o código fonte deste projeto &lt;b&gt;&lt;a href=&quot;http://www.mediafire.com/?znv59nld512h6f5&quot;&gt;aqui&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGM6RzQmule9k3iAyYygFjEoaSyne0htm1DS3YNCjGwAEKc2zFegx8qbn9BmsZHd0ix70yiE-ovik83lgX7CNvDt06YJ1L-NXb-OhcBu7qGU2lENT-rntJbGdVa5Tp_Pz_0GMErHRZDwIg/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGM6RzQmule9k3iAyYygFjEoaSyne0htm1DS3YNCjGwAEKc2zFegx8qbn9BmsZHd0ix70yiE-ovik83lgX7CNvDt06YJ1L-NXb-OhcBu7qGU2lENT-rntJbGdVa5Tp_Pz_0GMErHRZDwIg/s400/1.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVT48aEiCLhxq6PNScjE-D9PVMS9Gsx71TBdLvbIAZJS6kqi4A2_y1OwfBwF1ALwqcEPf3fWkao7SO6I_kdkgBTzDPrVbifzh3aCdLMFfagy20FWD4SkwJjGESVYZM0upowUZHE3ce5veZ/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;203&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVT48aEiCLhxq6PNScjE-D9PVMS9Gsx71TBdLvbIAZJS6kqi4A2_y1OwfBwF1ALwqcEPf3fWkao7SO6I_kdkgBTzDPrVbifzh3aCdLMFfagy20FWD4SkwJjGESVYZM0upowUZHE3ce5veZ/s400/2.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg05H65P2j8yAU9Pvab_50dU-Ns5H22YBVPPq5w7BY3WocZd5l91ID3ZBr3PehmI1Xm9oWHju4Yqks5btOpqWCKiLfrXdOplTOjdcs5BFxGCsHRTWo2ew5e7gJdCou9_-KJx71HXCxNzhfo/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;86&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg05H65P2j8yAU9Pvab_50dU-Ns5H22YBVPPq5w7BY3WocZd5l91ID3ZBr3PehmI1Xm9oWHju4Yqks5btOpqWCKiLfrXdOplTOjdcs5BFxGCsHRTWo2ew5e7gJdCou9_-KJx71HXCxNzhfo/s400/3.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraços e até a próxima.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/afiliado/838361&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img height=&quot;60&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-programacao-e-desenvolvimento.gif&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/7258368698916754858/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/09/criando-um-editor-pascal-em-delphi.html#comment-form' title='3 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/7258368698916754858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/7258368698916754858'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/09/criando-um-editor-pascal-em-delphi.html' title='Criando um Editor Pascal em Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4Y_9v7ZY5xlBMVmO5twWhB_P50eliiJnFfrSq6wPJGy5fVyGjWsWvhmI4Ow0gS_DblITepkghc1hyphenhyphenVzOIxOOqusPpqvAp4E9ZOxhafCUHx3PvSIN2Ng_vza3G_D-j1QuhYlCLY8v8aRmR/s72-c/2.PNG" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-9135129537946838187</id><published>2012-09-02T10:43:00.002-07:00</published><updated>2012-09-02T15:37:28.128-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Trabalhando com Date em Delphi</title><content type='html'>Trabalhar com datas e horas são fundamentais para qualquer aplicação comercial, para controlar a data e a hora que o funcionário entra e sai ou quando uma venda foi efetuada...&lt;br /&gt;
Existem diversas funções e procedimentos capazes de manipular datas e horas, e hoje vou mostrar algumas das rotinas mais usadas e como usa-las.&lt;br /&gt;
&lt;br /&gt;
-Função &lt;b&gt;Date&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A função Date mostra a data no formato dd/mm/aaaa, vamos a um exemplo.&lt;br /&gt;
&lt;br /&gt;
ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Hoje é &#39;&lt;/span&gt; + DateToStr(Date));&lt;br /&gt;
&lt;br /&gt;
Perceba que, usamos &lt;i&gt;DateToStr&lt;/i&gt;&amp;nbsp;para converter Date para String, pois &lt;i&gt;ShowMessage&lt;/i&gt;&amp;nbsp;aceita apenas &lt;i&gt;String&lt;/i&gt;&amp;nbsp;e &lt;i&gt;Date&lt;/i&gt;&amp;nbsp;é do tipo &lt;i&gt;DateTime.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKjnx8Jr7WEZfI_WiTQsihH712ffMBsGxlZlWM7rMHulbfN8g9np8lwFFOW90syhTmD7IIEdYzSZHS0ExNpndYTCTsUrScof86GrG_AzFb94dkB0LdMAaskZ0BnooaKa0EnWfJSjVisYSY/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKjnx8Jr7WEZfI_WiTQsihH712ffMBsGxlZlWM7rMHulbfN8g9np8lwFFOW90syhTmD7IIEdYzSZHS0ExNpndYTCTsUrScof86GrG_AzFb94dkB0LdMAaskZ0BnooaKa0EnWfJSjVisYSY/s320/1.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
-&lt;b&gt;Now&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Podemos usar também o comando &lt;i&gt;Now&lt;/i&gt;&amp;nbsp;ao invés de &lt;i&gt;Date, &lt;/i&gt;mas para isso, deveríamos converte-lo de &lt;i&gt;DataTimeToStr&lt;/i&gt;&amp;nbsp;para &lt;i&gt;String&lt;/i&gt;.&lt;br /&gt;
Com isso, ele mostra não só a data, mas também a hora em hh:mm:ss.&lt;br /&gt;
&lt;br /&gt;
ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Hoje é &#39; +&amp;nbsp;&lt;/span&gt;DataTimeToStr(Now));&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ04M_OKXswnuE2_0IbO8x-oHUhnIhxsP9Jla9M-xqspHfRBQN5c0q5AJ7xPLTymrvDxNgvM-a1XjZfiHywSk4o5pq23jKHhe9PlaUNEYiwkx5C5cq0kvZngmEk2J4fpXEv7MnjmyvCkB6/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;102&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ04M_OKXswnuE2_0IbO8x-oHUhnIhxsP9Jla9M-xqspHfRBQN5c0q5AJ7xPLTymrvDxNgvM-a1XjZfiHywSk4o5pq23jKHhe9PlaUNEYiwkx5C5cq0kvZngmEk2J4fpXEv7MnjmyvCkB6/s320/2.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
-&lt;b&gt;ShortDayNames &lt;/b&gt;e &lt;b&gt;LongDayNames&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Mostram respectivamente o dia do mês curto e escrito por extenso. (&lt;i&gt;Jan&lt;/i&gt;&amp;nbsp;/ &lt;i&gt;Janeiro).&lt;/i&gt;&lt;br /&gt;
Para isso, usamos o índice do dia da semana, de 1 a 7.&lt;br /&gt;
&lt;br /&gt;
1-Domingo&lt;br /&gt;
2-Segunda&lt;br /&gt;
3-Terça&lt;br /&gt;
4-Quarta&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
Por exemplo, para mostrar o domingo, usamos:&lt;br /&gt;
&lt;br /&gt;
LongDayNames[1];&lt;br /&gt;
&lt;br /&gt;
ou&lt;br /&gt;
&lt;br /&gt;
ShowMessage(LongDayNames[1]);&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsEs2F64A2pX_tM7foD57-ylTZIv-zSamEF6CqfDMsSPnlxmEKm9D5WM8dGhmYtWkzK_TrIJy_6tpsGh0QdJOfMCJekXtsbSR1iWMmhkKIrzBZ2u6hW6ablGzUnm2dN1AWRxHZILooKql1/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;109&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsEs2F64A2pX_tM7foD57-ylTZIv-zSamEF6CqfDMsSPnlxmEKm9D5WM8dGhmYtWkzK_TrIJy_6tpsGh0QdJOfMCJekXtsbSR1iWMmhkKIrzBZ2u6hW6ablGzUnm2dN1AWRxHZILooKql1/s320/3.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Se nós usarmos &lt;i&gt;ShortDayNames&lt;/i&gt;&amp;nbsp;o resultado seria:&lt;br /&gt;
&lt;br /&gt;
ShowMessage(ShortDayNames[&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;]);&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo-4EABubqayNA-FMm2w085DxAWq-f11CgpA5S-kbncD06tmKuQfrUHTJ57ow50P-aX4eY5LqajvpaTfO1hsXosKRo7RXdLzmzq1yOd3aWPAoh-T_6N5mlJ7ZGGhlG6DnQwsWrIF9O0the/s1600/4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;107&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo-4EABubqayNA-FMm2w085DxAWq-f11CgpA5S-kbncD06tmKuQfrUHTJ57ow50P-aX4eY5LqajvpaTfO1hsXosKRo7RXdLzmzq1yOd3aWPAoh-T_6N5mlJ7ZGGhlG6DnQwsWrIF9O0the/s320/4.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
-&lt;b&gt;DayOfWeek&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Esse nos permite mostrar o dia da semana sem informar seu índice, por exemplo, quero saber que dia é hoje, então usamos a combinação de &lt;i&gt;LongDayNames,&lt;/i&gt;&amp;nbsp;&lt;i&gt;DayOfWeek &lt;/i&gt;e &lt;i&gt;Now&lt;/i&gt;&amp;nbsp;para informar o dia de hoje.&lt;br /&gt;
&lt;br /&gt;
ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Hoje é &#39;&lt;/span&gt; + LongDayNames[DayOfWeek(Now)]);&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPrpKf2o5tH5QenoAwSu40NKIjuH4SPmgNalNamwL1g1ogRaouTft27i58Q8UjeMNACLAs9kqZ5h1zBQV_ZfDpNTA9TVh3F4xMBZAOtIpJiAFSLx6xhAxUhMqbIo8oi2q30MomjjDNu7VS/s1600/5.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPrpKf2o5tH5QenoAwSu40NKIjuH4SPmgNalNamwL1g1ogRaouTft27i58Q8UjeMNACLAs9kqZ5h1zBQV_ZfDpNTA9TVh3F4xMBZAOtIpJiAFSLx6xhAxUhMqbIo8oi2q30MomjjDNu7VS/s320/5.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
-&lt;b&gt;DayOfTheMonth &lt;/b&gt;e &lt;b&gt;DayOfTheYear&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;i&gt;DayOfTheMonth &lt;/i&gt;retorna o dia do mês, no caso, em número.&lt;br /&gt;
&lt;br /&gt;
ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Hoje é dia&#39;&lt;/span&gt; + IntToStr(DayOfTheMonth(Now)));&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcoyqAtOjKAVa-1fVw4Py8LV4GjJsDIJ1SLJ0httivi0kMM2-VXaMtljzf8jnTR5lsf14WK_OuIIBwiV14D8VUY9EiSaBgKpNSuSkVSAPiquRV8vh9t9rdjrcGlGY9AtcYjLp_J_wm_RUv/s1600/6.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcoyqAtOjKAVa-1fVw4Py8LV4GjJsDIJ1SLJ0httivi0kMM2-VXaMtljzf8jnTR5lsf14WK_OuIIBwiV14D8VUY9EiSaBgKpNSuSkVSAPiquRV8vh9t9rdjrcGlGY9AtcYjLp_J_wm_RUv/s320/6.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;DayOfTheYear&lt;/i&gt;&amp;nbsp;nos retorna qual o dia do ano, neste caso, já se passaram 246 dias desde 1 de Janeiro.&lt;br /&gt;
&lt;br /&gt;
ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Hoje é o dia &#39;&lt;/span&gt; + IntToStr(DayOfTheYear(Now)) +&lt;span style=&quot;color: blue;&quot;&gt; &#39; do ano.&#39;&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7SyrBdvWEdqWDuWeh9dxtOD81NbrDnKdVOE1S6hacHBb7xcJhaNXtDeuFeNETNzw40dSFkVo0eM39Uf8YA3Sxmzv18i3yOMCMKf7ud0g1bi_3FgW9rxliOR9cfOlXWuUzF1CRpdFfsyL/s1600/7.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;107&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ7SyrBdvWEdqWDuWeh9dxtOD81NbrDnKdVOE1S6hacHBb7xcJhaNXtDeuFeNETNzw40dSFkVo0eM39Uf8YA3Sxmzv18i3yOMCMKf7ud0g1bi_3FgW9rxliOR9cfOlXWuUzF1CRpdFfsyL/s320/7.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;IntToStr&lt;/i&gt;&amp;nbsp;para converter &lt;i&gt;Integer&lt;/i&gt;&amp;nbsp;para &lt;i&gt;String,&lt;/i&gt;&amp;nbsp;pois as funções retornam números inteiros e &lt;i&gt;ShowMessage&lt;/i&gt;&amp;nbsp;só recebe &lt;i&gt;String.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;-&lt;/i&gt;&lt;b&gt;LongMonthNames &lt;/b&gt;e &lt;b&gt;MonthOfTheYear&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Da mesma maneira que podemos trabalhar com dias, podemos também trabalhar com os meses.&lt;br /&gt;
&lt;br /&gt;
ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Estamos no mês de &#39;&lt;/span&gt; + LongMonthNames[MonthOfTheYear(Now)]);&lt;br /&gt;
&lt;br /&gt;
Também pode-se trabalhar com &lt;i&gt;ShortMonthNames&lt;/i&gt;&amp;nbsp;para mostrar os meses abreviados.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1GMx7dYX-Ejzlvgc-HOswH772OgzMDmbzr2-eQ_OHgPzyVkCXV7A1ZnoTA3IUM_52whSvXZf5OVeDiVltW5KtyV2tOixgELkpxLfrTsMMhmjkpxn596h-LFFlSA9gZ07LTDF18pPGDCZE/s1600/8.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;104&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1GMx7dYX-Ejzlvgc-HOswH772OgzMDmbzr2-eQ_OHgPzyVkCXV7A1ZnoTA3IUM_52whSvXZf5OVeDiVltW5KtyV2tOixgELkpxLfrTsMMhmjkpxn596h-LFFlSA9gZ07LTDF18pPGDCZE/s320/8.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Em breve faço um artigo com as outras funções para utilizar datas e &lt;i&gt;Time&lt;/i&gt;&amp;nbsp;em Delphi.&lt;br /&gt;
Abraço e até a próxima.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/afiliado/838361&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img height=&quot;60&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-programacao-e-desenvolvimento.gif&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/9135129537946838187/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/09/trabalhando-com-date-em-delphi.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/9135129537946838187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/9135129537946838187'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/09/trabalhando-com-date-em-delphi.html' title='Trabalhando com Date em Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKjnx8Jr7WEZfI_WiTQsihH712ffMBsGxlZlWM7rMHulbfN8g9np8lwFFOW90syhTmD7IIEdYzSZHS0ExNpndYTCTsUrScof86GrG_AzFb94dkB0LdMAaskZ0BnooaKa0EnWfJSjVisYSY/s72-c/1.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-6507346178801693006</id><published>2012-08-25T14:45:00.002-07:00</published><updated>2012-09-02T15:36:07.468-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cursos"/><title type='text'>Cursos de Programação iPED</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/afiliado/838361&quot;&gt;&lt;img src=&quot;http://www.iped.com.br/_img/parceiros/250x250/banner-programacao-e-desenvolvimento.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
E aí galera blz?&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Estou aqui para falar sobre o &lt;a href=&quot;http://www.iped.com.br/afiliado/838361&quot;&gt;Grupo iPED&lt;/a&gt;, onde você pode fazer cursos á distância com obtenção de certificado.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Além do mais, os preços estão bem em conta. Segue a lista dos cursos de Programação e Desenvolvimento.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/delphi/afiliado/838361&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;http://www.iped.com.br/img/cursos/40.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/delphi/afiliado/838361&quot;&gt;&lt;b&gt;Curso de Delphi&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;de R$&amp;nbsp;&lt;/span&gt;&lt;s style=&quot;color: #333333; text-align: center;&quot;&gt;79,90&lt;/s&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;&amp;nbsp;por&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;strong style=&quot;color: #3ba54b; text-align: center;&quot;&gt;3x de R$ 19,97&lt;/strong&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;sem juros no cartão&lt;/span&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;ou&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;R$ 59,90 à vista&lt;/strong&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/java/afiliado/838361&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;http://www.iped.com.br/img/cursos/1315.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/java/afiliado/838361&quot;&gt;Curso de Java&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;de R$&amp;nbsp;&lt;/span&gt;&lt;s style=&quot;color: #333333; text-align: center;&quot;&gt;79,90&lt;/s&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;&amp;nbsp;por&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;strong style=&quot;color: #3ba54b; text-align: center;&quot;&gt;3x de R$ 19,97&lt;/strong&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;sem juros no cartão&lt;/span&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;ou&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;R$ 59,90 à vista&lt;/strong&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/vb-net/afiliado/838361&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;http://www.iped.com.br/img/cursos/1276.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/vb-net/afiliado/838361&quot;&gt;Curso de Visual Basic .Net&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Sans Unicode&#39;, &#39;Lucida Grande&#39;, sans-serif; font-size: 13px; text-align: center;&quot;&gt;de R$&amp;nbsp;&lt;/span&gt;&lt;s style=&quot;color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Sans Unicode&#39;, &#39;Lucida Grande&#39;, sans-serif; font-size: 13px; text-align: center;&quot;&gt;79,90&lt;/s&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Sans Unicode&#39;, &#39;Lucida Grande&#39;, sans-serif; font-size: 13px; text-align: center;&quot;&gt;&amp;nbsp;por&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #3ba54b; text-align: center;&quot;&gt;3x de R$ 19,97&lt;/strong&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;sem juros no cartão&lt;/span&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;ou&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;R$ 59,90 à vista&lt;/strong&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/php-mysql/afiliado/838361&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;http://www.iped.com.br/img/cursos/3290.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/php-mysql/afiliado/838361&quot;&gt;Curso de PHP e MySQL&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Sans Unicode&#39;, &#39;Lucida Grande&#39;, sans-serif; font-size: 13px; text-align: center;&quot;&gt;de R$&amp;nbsp;&lt;/span&gt;&lt;s style=&quot;color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Sans Unicode&#39;, &#39;Lucida Grande&#39;, sans-serif; font-size: 13px; text-align: center;&quot;&gt;79,90&lt;/s&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Sans Unicode&#39;, &#39;Lucida Grande&#39;, sans-serif; font-size: 13px; text-align: center;&quot;&gt;&amp;nbsp;por&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #3ba54b; text-align: center;&quot;&gt;3x de R$ 19,97&lt;/strong&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;sem juros no cartão&lt;/span&gt;&lt;br style=&quot;color: #333333; text-align: center;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; text-align: center;&quot;&gt;ou&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;R$ 59,90 à vista&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt; &lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #333333;&quot;&gt;&lt;b&gt;Outros Cursos &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;/span&gt; &lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;color: #333333; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/asp/afiliado/838361&quot;&gt;ASP&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/dreamweaver-cs3/afiliado&quot;&gt;Dreamweaver CS3&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/dreamweaver-cs5/afiliado/838361&quot;&gt;Dreamweaver CS5&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/html5/afiliado/838361&quot;&gt;HTML5&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/logica/afiliado/838361&quot;&gt;Lógica de Programação&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/oracle/afiliado/838361&quot;&gt;Oracle 10g&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/sql-server/afiliado/838361&quot;&gt;SQL Server&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/curso/visual-basic-6/afiliado/838361&quot;&gt;Visual Basic 6&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/afiliado/838361&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img height=&quot;60&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-programacao-e-desenvolvimento.gif&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/6507346178801693006/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/08/cursos-de-programacao-iped.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/6507346178801693006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/6507346178801693006'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/08/cursos-de-programacao-iped.html' title='Cursos de Programação iPED'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-3053041211393212241</id><published>2012-08-25T13:46:00.007-07:00</published><updated>2012-08-31T14:18:33.307-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Selecionar Pasta - Delphi</title><content type='html'>Eis uma função para exibir uma caixa de diálogo para selecionar uma pasta em Delphi.&lt;br /&gt;
Primeiramente adicione a &lt;i&gt;uses&lt;/i&gt;&amp;nbsp;&lt;b&gt;FileCtrl&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;procedure &lt;/span&gt;TForm1.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;var&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; selDir : &lt;span style=&quot;color: purple;&quot;&gt;string&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; SelectDirectory(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Selecione uma pasta&#39;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&#39;C:\&#39;&lt;/span&gt;, selDir);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlndO5Vu57Fqtk4hruJWUHynLADJS2aPQ-04ZgNQ16snw8AmW5GatuTGcanQqj5RFBisrJSyOp0_2EI0JuTc8uWuM-NSRa3GG5CxmAxRVe5ChND6cZHI8SRYueNa4VEbMweklGtFPYNqmM/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlndO5Vu57Fqtk4hruJWUHynLADJS2aPQ-04ZgNQ16snw8AmW5GatuTGcanQqj5RFBisrJSyOp0_2EI0JuTc8uWuM-NSRa3GG5CxmAxRVe5ChND6cZHI8SRYueNa4VEbMweklGtFPYNqmM/s320/1.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Explicando....&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt; Declaramos &lt;i&gt;selDir&lt;/i&gt;&amp;nbsp;como &lt;i&gt;string&lt;/i&gt;, pois ela armazenará o caminho que o usuário escolher.&lt;br /&gt;
&lt;i&gt;SelectDiretory&lt;/i&gt;&amp;nbsp;é a função para exibir a caixa de diálogo de seleção de pasta.&lt;br /&gt;
O primeiro argumento é a mensagem que será exibida para o usuário.&lt;br /&gt;
O segundo argumento é o diretório inicial da caixa de seleção.&lt;br /&gt;
E o terceiro, no caso, é onde será armazenado o local que o usuário escolheu.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Manipulando a variável &lt;i&gt;selDir.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;procedure&amp;nbsp;&lt;/span&gt;TForm1.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;var&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; selDir :&amp;nbsp;&lt;span style=&quot;color: purple;&quot;&gt;string&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: purple;&quot;&gt;if &lt;/span&gt;SelectDirectory(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Selecione uma pasta&#39;&lt;/span&gt;,&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&#39;C:\&#39;&lt;/span&gt;, selDir) &lt;span style=&quot;color: purple;&quot;&gt;then&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ShowMessage(&lt;span style=&quot;color: blue;&quot;&gt;&#39;Você escolheu a pasta &#39;&lt;/span&gt; + selDir);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4bWUfwzKGyX1na2aAQRdxCFDc3UQsGeS-qhPE1dbRm1VFRlI5DLB9zkpWJHpLQoFxdSqwdwRMPKSMV3Ta8nFpbSw5d-ku1sE0NmaWdXzGQu1A8xShBzmip6pJnOMOFcl9z-1aewDLfkoN/s1600/2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4bWUfwzKGyX1na2aAQRdxCFDc3UQsGeS-qhPE1dbRm1VFRlI5DLB9zkpWJHpLQoFxdSqwdwRMPKSMV3Ta8nFpbSw5d-ku1sE0NmaWdXzGQu1A8xShBzmip6pJnOMOFcl9z-1aewDLfkoN/s400/2.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Abraço e até a próxima! (:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Início do código HTML Cursos 24 Horas --&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.cursos24horas.com.br/parceiro.asp?cod=promocao29388&amp;amp;url=cursos/informatica&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Cursos Online na Área de Informática&quot; height=&quot;60&quot; src=&quot;http://www.cursos24h.net.br/banners/areas/informatica/gif/468x60.gif&quot; style=&quot;border: none;&quot; width=&quot;468&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/3053041211393212241/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/08/selecionar-pasta-delphi.html#comment-form' title='4 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3053041211393212241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/3053041211393212241'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/08/selecionar-pasta-delphi.html' title='Selecionar Pasta - Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlndO5Vu57Fqtk4hruJWUHynLADJS2aPQ-04ZgNQ16snw8AmW5GatuTGcanQqj5RFBisrJSyOp0_2EI0JuTc8uWuM-NSRa3GG5CxmAxRVe5ChND6cZHI8SRYueNa4VEbMweklGtFPYNqmM/s72-c/1.PNG" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-5034023133274375250</id><published>2012-08-25T13:46:00.005-07:00</published><updated>2012-08-31T18:03:19.931-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Carregando um Cursor externo - Delphi</title><content type='html'>Este código faz com que seja possível carregar um cursor externo e substituir um dos cursores padrões do Windows em sua aplicação.&lt;br /&gt;
Basta que o cursor esteja no local especificado, e que você adicione o seguinte código ao evento onCreate do Form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;procedure &lt;/span&gt;TForm1.FormCreate(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Screen.Cursors[&lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;] := LoadCursorFromFile(&lt;span style=&quot;color: blue;&quot;&gt;&#39;shot.cur&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; Form1.Cursor := &lt;span style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0Rs_0MlqgRvmlV7wxC8troBLMXZPF_oAW1stZlJljiJRnK6E17kxoLajaHBatSi5kZMDjbQI6CVJRwUKzsMikWpNS7E9tKcvgywoaRKMWyOAv_z8ZHXufGV9SHXlWQp8GUBLr7B_Nq2f/s1600/4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;134&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0Rs_0MlqgRvmlV7wxC8troBLMXZPF_oAW1stZlJljiJRnK6E17kxoLajaHBatSi5kZMDjbQI6CVJRwUKzsMikWpNS7E9tKcvgywoaRKMWyOAv_z8ZHXufGV9SHXlWQp8GUBLr7B_Nq2f/s320/4.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;O código &lt;i&gt;Screen.Cursors&lt;/i&gt;&amp;nbsp;refere-se aos cursores do Windows e o índice &lt;i&gt;[1] &lt;/i&gt;&amp;nbsp;refere-se ao cursor padrão &lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;do Windows;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Então o cursor padrão é alterado pelo cursor &lt;i&gt;shot.cur&lt;/i&gt;&amp;nbsp;que foi carregado da pasta.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;E a última linha refere-se que o cursor do &lt;i&gt;Form1 &lt;/i&gt;é o 1, que foi substituído.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFkmmfbpMb2pULgXKJ-dl1AB9tJOHAj16c2NsI2VnpVJpywr99ZIzUmKVgV8GNVQrtada3ObPO61YjN4_GsqU5Xe4GNjUbmdJGpQrcbx0_m0E4zooWblmYdwVeaVmMlTtCusKBF3Cts_P8/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFkmmfbpMb2pULgXKJ-dl1AB9tJOHAj16c2NsI2VnpVJpywr99ZIzUmKVgV8GNVQrtada3ObPO61YjN4_GsqU5Xe4GNjUbmdJGpQrcbx0_m0E4zooWblmYdwVeaVmMlTtCusKBF3Cts_P8/s320/3.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Abraço e até a próxima.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;!-- Início do código HTML Cursos 24 Horas --&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.cursos24horas.com.br/parceiro.asp?cod=promocao29388&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Cursos On-line com Certificado - Cursos 24 Horas&quot; height=&quot;60&quot; src=&quot;http://www.cursos24h.net.br/banners/gif1/468x60.gif&quot; style=&quot;border: none;&quot; width=&quot;468&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/5034023133274375250/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/08/carregando-um-cursor-externo-delphi.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/5034023133274375250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/5034023133274375250'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/08/carregando-um-cursor-externo-delphi.html' title='Carregando um Cursor externo - Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0Rs_0MlqgRvmlV7wxC8troBLMXZPF_oAW1stZlJljiJRnK6E17kxoLajaHBatSi5kZMDjbQI6CVJRwUKzsMikWpNS7E9tKcvgywoaRKMWyOAv_z8ZHXufGV9SHXlWQp8GUBLr7B_Nq2f/s72-c/4.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-1489945924488480126</id><published>2012-08-23T07:50:00.002-07:00</published><updated>2012-08-31T18:09:19.204-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Criando uma DLL - Delphi</title><content type='html'>DLL ou Dynamic-Link Library é o nome que se dá á bibliotecas externas. Você já deve ter visto aplicações que utilizam diversas bibliotecas dessas, e hoje, vou falar um pouco mais sobre elas.&lt;br /&gt;
As DLLs podem conter funções e rotinas para qualquer aplicação. Isso facilita quando se trata de uma aplicação grande, e além de tudo, colocar as rotinas em DLLs economizam o espaço em disco e também a memória RAM em Runtime.&lt;br /&gt;
Além do mais, qualquer aplicação pode acessar as rotinas da DLLs.&lt;br /&gt;
&lt;br /&gt;
Para criar uma DLL, abra o Delphi e clique em &lt;b&gt;File&amp;gt;New&amp;gt;Other &lt;/b&gt;selecione a categoria &lt;b&gt;Delphi Projects&lt;/b&gt;&amp;nbsp;e &lt;b&gt;Dynamic-link Library.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Para criarmos alguma função ou rotina na DLL, podemos escreve-la acima do bloco begin-end. Ex:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;library&lt;/span&gt; minhaDLL;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;uses&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; System.SysUtils,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; System.Classes;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{$R *.res}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;function&amp;nbsp;&lt;/span&gt;Calcular(valor1: Real; operador: Char; valor2: Real):&amp;nbsp;&lt;b&gt;&lt;i&gt;&lt;u&gt;Real&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;var&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp; resultado: Real; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// variavel de retorno&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: purple;&quot;&gt;case&amp;nbsp;&lt;/span&gt;operador&amp;nbsp;&lt;span style=&quot;color: purple;&quot;&gt;of&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &#39;+&#39;&lt;/span&gt;: resultado := valor1 + valor2; &amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;// soma&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&#39;-&#39;&lt;/span&gt;: resultado := valor1 - valor2; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;// subtração&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&#39;*&#39;&lt;/span&gt;: resultado := valor1 * valor2; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;// multiplicação&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&#39;/&#39;&lt;/span&gt;: resultado := valor1 / valor2; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;// divisão&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp; result := resultado; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;&amp;nbsp;// retorna&amp;nbsp;&lt;i&gt;resultado&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;end.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Além de termos a rotina, ela ainda não pode ser usada pela aplicação. Para isso, temos que exporta-la, colocando a função na lista de exportação ainda acima do bloco begin-end.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;exports&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; Calcular;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Agora sim, a rotina foi exportada, porém podemos apenas utiliza-la em aplicações Delphi. Se quisermos utiliza-la em outras linguagens de programação, devemos marca-la com a diretiva &lt;i&gt;stdcall.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;Calcular(valor1: Real; operador: Char; valor2: Real):&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;Real&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;; &lt;span style=&quot;color: purple;&quot;&gt;stdcall&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;O modo mais simples para carregar uma DLL em sua aplicação, é o de carga estática. Para carregarmos ela em nossa aplicação, devemos declarar a função que queremos importar na diretiva &lt;i&gt;interface &lt;/i&gt;e mostrar o arquivo da DLL na diretiva &lt;i&gt;implementation.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Dessa forma, crie uma nova aplicação e adicione uma nova unidade. (&lt;b&gt;File&amp;gt;New&amp;gt;Unit&lt;/b&gt;).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;unit &lt;/span&gt;funcoesDLL;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;interface&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;function &lt;/span&gt;Calcular(valor1: Real; operador: Char; valor2: Real): Real; &lt;span style=&quot;color: purple;&quot;&gt;stdcall&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;implementation&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: purple;&quot;&gt;function &lt;/span&gt;Calcular; &lt;span style=&quot;color: purple;&quot;&gt;external &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;minhaDLL.dll&#39;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
end.&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Repare que, declaramos a função que está na DLL e na &lt;i&gt;implementation&lt;/i&gt;&amp;nbsp;mostramos onde está a função.&lt;br /&gt;
É possível importar a função com outro nome, desde que você mostra o nome da função depois.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; color: purple;&quot;&gt;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;FazContas(valor1: Real; operador: Char; valor2: Real): Real;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: purple;&quot;&gt;stdcall;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: purple;&quot;&gt;external&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;minhaDLL.dll&#39;&lt;/span&gt;; &lt;span style=&quot;color: purple;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;Calcular&#39;&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Eu salvei a unit como &lt;i&gt;funcoesDLL.pas&lt;/i&gt;, para que possamos importar em nossa aplicação.&lt;br /&gt;
Crie uma nova aplicação, e na &lt;i&gt;uses&lt;/i&gt;, adicione a unit &lt;i&gt;funcoesDLL&lt;/i&gt;&amp;nbsp;da qual acabamos de salvar.&lt;br /&gt;
&lt;br /&gt;
Agora basta chamar a função, desde que a &lt;i&gt;uses funcoesDLL&lt;/i&gt;&amp;nbsp;esteja importada.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;procedure &lt;/span&gt;TForm2.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;ShowMessage(FloatToStr(Calcular(&lt;/span&gt;&lt;span style=&quot;background-color: white; color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: white; color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;&#39;+&#39;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: white; color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&amp;nbsp;10&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;)));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Eis o resultado:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj68RrDeWABcotnUSEOdDI_A_CqZ3oorfM4gy9l1FVhM9LTVFHbXtQSaoBYkOGgRSPi59j7fIqxXZYU9RbfnP8HT-zR3bcqwmu0Gv5wyHJieJtIwG8p_gdhV-gtL4w4ESAhP0HA7vwhUv79/s1600/1.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj68RrDeWABcotnUSEOdDI_A_CqZ3oorfM4gy9l1FVhM9LTVFHbXtQSaoBYkOGgRSPi59j7fIqxXZYU9RbfnP8HT-zR3bcqwmu0Gv5wyHJieJtIwG8p_gdhV-gtL4w4ESAhP0HA7vwhUv79/s400/1.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
É isso ai galera, esse é o básico sobre DLLs utilizando o Delphi.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Até a próxima.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.mediafire.com/?7ydsr7l2wsftta7&quot;&gt;DLL_Delphi.rar&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.iped.com.br/programacao-e-desenvolvimento/afiliado/838361&quot;&gt;&lt;img height=&quot;73&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-programacao-e-desenvolvimento.gif&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/1489945924488480126/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/08/criando-uma-dll-delphi.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1489945924488480126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/1489945924488480126'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/08/criando-uma-dll-delphi.html' title='Criando uma DLL - Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj68RrDeWABcotnUSEOdDI_A_CqZ3oorfM4gy9l1FVhM9LTVFHbXtQSaoBYkOGgRSPi59j7fIqxXZYU9RbfnP8HT-zR3bcqwmu0Gv5wyHJieJtIwG8p_gdhV-gtL4w4ESAhP0HA7vwhUv79/s72-c/1.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6255869376176704484.post-8951869025197715433</id><published>2012-08-19T17:30:00.001-07:00</published><updated>2012-09-02T15:39:04.255-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delphi"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutoriais Delphi"/><title type='text'>Funções - Delphi</title><content type='html'>Funções são parecidas com Procedimentos, mas a única diferença é que as funções retornam um valor.&lt;br /&gt;
Por exemplo:&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;function&lt;/span&gt; &amp;lt;nome_da_funcao&amp;gt;(&amp;lt;argumento1&amp;gt;: &amp;lt;tipo&amp;gt;; &amp;lt;argumento2&amp;gt;: &amp;lt;tipo&amp;gt;):&amp;lt;retorno&amp;gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;result&lt;/span&gt; := &amp;lt;variavel&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Onde, &lt;i&gt;result := variavel&amp;nbsp;&lt;/i&gt;&amp;nbsp;indica a variável que será retornada pela função. Lembrando que o tipo da variável tem que ser o mesmo tipo indicado no &lt;i&gt;retorno.&lt;/i&gt;&lt;br /&gt;
Exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;span style=&quot;color: #274e13; font-family: Courier New, Courier, monospace;&quot;&gt;// O tipo de retorno da variável será Real, conforme negritado abaixo:&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;function &lt;/span&gt;Calcular(valor1: Real; operador: Char; valor2: Real): &lt;b&gt;&lt;i&gt;&lt;u&gt;Real&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;var&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; resultado: Real; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// variavel de retorno&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: purple;&quot;&gt;case &lt;/span&gt;operador &lt;span style=&quot;color: purple;&quot;&gt;of&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &#39;+&#39;&lt;/span&gt;: resultado := valor1 + valor2; &amp;nbsp;&lt;span style=&quot;color: #38761d;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;// soma&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt; &#39;-&#39;&lt;/span&gt;: resultado := valor1 - valor2; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #274e13;&quot;&gt;// subtração&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&#39;*&#39;&lt;/span&gt;: resultado := valor1 * valor2; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt;// multiplicação&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&#39;/&#39;&lt;/span&gt;: resultado := valor1 / valor2; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #274e13;&quot;&gt;&amp;nbsp;// divisão&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; result := resultado; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #274e13;&quot;&gt; &amp;nbsp;// retorna &lt;i&gt;resultado&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;end;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
A função acima, recebe &lt;i&gt;valor1&amp;nbsp;&lt;/i&gt;que é do tipo &lt;i&gt;Real&lt;/i&gt;, recebe &lt;i&gt;operador&lt;/i&gt;&amp;nbsp;que é do tipo &lt;i&gt;Char&lt;/i&gt;&amp;nbsp;e recebe &lt;i&gt;valor2&lt;/i&gt;&amp;nbsp;que é do tipo &lt;i&gt;Real&lt;/i&gt;, além de ter a variável de retorno do tipo &lt;i&gt;Real;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Podemos chamar a função da seguinte maneira:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;procedure &lt;/span&gt;TForm1.Button1Click(Sender: TObject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: purple; font-family: Courier New, Courier, monospace;&quot;&gt;begin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; ShowMessage(FloatToStr(Calcular(&lt;span style=&quot;color: blue;&quot;&gt;50&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt; &#39;*&#39;&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt; 10&lt;/span&gt;)));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;end&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;i&gt;* FloatToStr&lt;/i&gt;&amp;nbsp;converte Real para String, pois &lt;i&gt;ShowMessage&lt;/i&gt;&amp;nbsp;recebe apenas String e &lt;i&gt;Calcular&lt;/i&gt;&amp;nbsp;é do tipo Real.&lt;br /&gt;
* Repare os argumentos da função &lt;i&gt;Calcular&lt;/i&gt;.&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;Calcular(50, &#39;*&#39;, 10);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
O primeiro argumento (valor1: Real) é 50.&lt;br /&gt;
O segundo argumento (operador: Char) é &#39;*&#39;. Poderia ser &#39;-&#39;, &#39;/&#39; ou &#39;-&#39;.&lt;br /&gt;
O terceiro argumento (valor2: Real) é 10.&lt;br /&gt;
Tudo conforme programado na função &lt;i&gt;Calcular&lt;/i&gt;. Assim podemos ver o resultado.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Calcular(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&#39;*&#39;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;10&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMEO12egimbcTm1CtJdu-LnlOtOnMOzu3LmtcAN3N6e41NBazczLsEW5M_9WO_Z4TI9N974AQIHJpoHL23D8MPDIkn9INZAYSsWX58qpZKaKpo6NjK7R6JArHCuBnk7PjFgkyFRTfNxm74/s1600/3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;175&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMEO12egimbcTm1CtJdu-LnlOtOnMOzu3LmtcAN3N6e41NBazczLsEW5M_9WO_Z4TI9N974AQIHJpoHL23D8MPDIkn9INZAYSsWX58qpZKaKpo6NjK7R6JArHCuBnk7PjFgkyFRTfNxm74/s400/3.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Por hoje é isso galera, no próximo artigo, falarei sobre DLLs em Delphi.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Abraço e até a próxima.&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.iped.com.br/3d-e-games/afiliado/838361&quot;&gt;&lt;img height=&quot;73&quot; src=&quot;http://www.iped.com.br/_img/parceiros/728x90/banner-3d-e-games.gif&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://programadoronline.blogspot.com/feeds/8951869025197715433/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://programadoronline.blogspot.com/2012/08/funcoes-delphi.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/8951869025197715433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6255869376176704484/posts/default/8951869025197715433'/><link rel='alternate' type='text/html' href='http://programadoronline.blogspot.com/2012/08/funcoes-delphi.html' title='Funções - Delphi'/><author><name>Programador Online</name><uri>http://www.blogger.com/profile/08638791950989035325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMEO12egimbcTm1CtJdu-LnlOtOnMOzu3LmtcAN3N6e41NBazczLsEW5M_9WO_Z4TI9N974AQIHJpoHL23D8MPDIkn9INZAYSsWX58qpZKaKpo6NjK7R6JArHCuBnk7PjFgkyFRTfNxm74/s72-c/3.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>