I just wanted to ask a simple question... lazarus / 21-General ---------------------------------------------------------------------- nightrider43 · 2024-10-31 23:52 I have already consulted charGPT, Gemini, Meta AI and Lazarus Wiki. I can't get rid of the compilation error of the MessageDlg command in the code below. I beg for someone's help. What a complex thing. I just want to ask YES or NO with the default NO. Code below: procedure TfrmGeraString.btnGoMainClick(Sender: TObject);   var resposta : integer;   begin     if Length (tedtNomArqMic.Text) = 0 then        begin;          ShowMessage ('Informe nome do arquivo no microcomputador');          Exit;        end     else        if Length (cbxNomArqMain.Text) = 0 then           begin;             ShowMessage ('Informe nome do arquivo do mainframe');             Exit;           end        else           if (Pos('(',cbxNomArqMain.Text) <> 0) and (Pos(')',cbxNomArqMain.Text) = 0) or              (Pos('(',cbxNomArqMain.Text) = 0) and (Pos(')',cbxNomArqMain.Text) <> 0) then              begin;                ShowMessage ('Parênteses do nome do arquivo do mainframe mal colocados');                cbxNomArqMain.SetFocus;                Exit;              end           else              begin;                nomarqmic := ExtractFileName (tedtNomArqMic.Text);                if (Length (nomarqmic) <> 0) and (Pos (nomarqmic,cbxNomArqMain.Text) = 0) then                      begin;                        ShowMessage ('Alerta: O nome do arquivo do micro não ' +                                    'aparece no nome do arquivo do mainframe');                        resposta = MessageDlg ('Confirma:','Continuar o processamento?',mtConfirmation,[mbYes, mbNo],0);                        if resposta = mrNo then                           cbxNomArqMain.SetFocus;                      end;                MontaString (tedtNomArqMic.Text,cbxNomArqMain.Text,rbTransMicro.Checked);                ShowMessage('Clique Fim para gravar o arquivo com o string de transmissão ou selecione um radio button para gerar outro comando de transmissão');                tedtNomArqMic.Clear;                cbxNomArqMain.Text := '';              end;   end; Greetings from São Paulo - Brazil Arí Ricardo Ody ---------------------------------------------------------------------- Fibonacci · 2024-10-31 23:57 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i resposta = MessageDlg Change to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i resposta := MessageDlg Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TfrmGeraString.btnGoMainClick(Sender: TObject);var  resposta: integer;begin  if Length(tedtNomArqMic.Text) = 0 then begin    ShowMessage('Informe nome do arquivo no microcomputador');    Exit;  end else if Length(cbxNomArqMain.Text) = 0 then begin    ShowMessage('Informe nome do arquivo do mainframe');    Exit;  end else if (Pos('(', cbxNomArqMain.Text) <> 0) and (Pos(')', cbxNomArqMain.Text) = 0) or    (Pos('(', cbxNomArqMain.Text) = 0) and (Pos(')', cbxNomArqMain.Text) <> 0) then begin    ShowMessage('Parênteses do nome do arquivo do mainframe mal colocados');    cbxNomArqMain.SetFocus;    Exit;  end else begin    nomarqmic := ExtractFileName(tedtNomArqMic.Text);    if (Length(nomarqmic) <> 0) and (Pos(nomarqmic, cbxNomArqMain.Text) = 0) then begin      ShowMessage('Alerta: O nome do arquivo do micro não ' +        'aparece no nome do arquivo do mainframe');      resposta := MessageDlg('Confirma:', 'Continuar o processamento?', mtConfirmation, [mbYes, mbNo], 0);      if resposta = mrNo then cbxNomArqMain.SetFocus;    end;    MontaString(tedtNomArqMic.Text, cbxNomArqMain.Text, rbTransMicro.Checked);    ShowMessage('Clique Fim para gravar o arquivo com o string de transmissão ou selecione um radio button para gerar outro comando de transmissão');    tedtNomArqMic.Clear;    cbxNomArqMain.Text := '';  end;end; ---------------------------------------------------------------------- egsuh · 2024-11-01 10:24 If you are using Exit, you don't have to add else after that. But not sure in readability. If you insist using "else" then you don't have to put Exit. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TfrmGeraString.btnGoMainClick(Sender: TObject);var  resposta: integer;begin  if Length(tedtNomArqMic.Text) = 0 then begin    ShowMessage('Informe nome do arquivo no microcomputador');    Exit;  end;   if Length(cbxNomArqMain.Text) = 0 then begin    ShowMessage('Informe nome do arquivo do mainframe');    Exit;  end;   if (Pos('(', cbxNomArqMain.Text) <> 0) and (Pos(')', cbxNomArqMain.Text) = 0) or    (Pos('(', cbxNomArqMain.Text) = 0) and (Pos(')', cbxNomArqMain.Text) <> 0) then begin    ShowMessage('Parênteses do nome do arquivo do mainframe mal colocados');    cbxNomArqMain.SetFocus;    Exit;  end;    nomarqmic := ExtractFileName(tedtNomArqMic.Text);   .... end; ---------------------------------------------------------------------- nightrider43 · 2024-11-02 13:10 Hello! I have no explanation to justify not having noticed the lack of the 2-dot graphic symbol. It was a naive and horrible mistake. Thank you for your reply. I am even embarrassed. Thank you once again for your tolerance. Greetings from São Paulo - Brazil Arí Ricardo Ody ---------------------------------------------------------------------- DavidL · 2024-11-02 13:33 Quote from: nightrider43 on November 02, 2024, 02:10:08 pmHello! I have no explanation to justify not having noticed the lack of the 2-dot graphic symbol. It was a naive and horrible mistake. Thank you for your reply. I am even embarrassed. Thank you once again for your tolerance. Greetings from São Paulo - Brazil Arí Ricardo Ody Don't be so hard on yourself.  It will happen again.  It's a very common mistake that, even after almost 50 years of writing software, I still make.  The C language equivalent is "=" and "==" - that one can drive you nuts for sure. ---------------------------------------------------------------------- carl_caulkett · 2024-11-02 22:54 Quote from: nightrider43 on November 02, 2024, 02:10:08 pmHello! I have no explanation to justify not having noticed the lack of the 2-dot graphic symbol. It was a naive and horrible mistake. Thank you for your reply. I am even embarrassed. Thank you once again for your tolerance. Greetings from São Paulo - Brazil Arí Ricardo Ody You might be interested in this code template which allow you to insert a := simply by pressing ;; followed by a space. Code Templates are so cool. You can build up a set of useful little templates which make some incremental improvements to your work flow ---------------------------------------------------------------------- Fibonacci · 2024-11-02 23:01 Quote from: carl_caulkett on November 02, 2024, 11:54:11 pmYou might be interested in this code template which allow you to insert a := simply by pressing ;; followed by a space. Code Templates are so cool. You can build up a set of useful little templates which make some incremental improvements to your work flow Ur Lazarus version? Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [Error] The token can only contain Latin letters, numbers and underscores, and cannot begin with a number. [OK] ---------------------------------------------------------------------- carl_caulkett · 2024-11-03 00:49 Quote from: Fibonacci on November 03, 2024, 12:01:52 amQuote from: carl_caulkett on November 02, 2024, 11:54:11 pmYou might be interested in this code template which allow you to insert a := simply by pressing ;; followed by a space. Code Templates are so cool. You can build up a set of useful little templates which make some incremental improvements to your work flow Ur Lazarus version? Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [Error] The token can only contain Latin letters, numbers and underscores, and cannot begin with a number. [OK] FPC 3.3.1 / Lazarus 3.99, but I'm pretty sure this worked in FPC 3.2 / Lazarus 3.4 as well. ---------------------------------------------------------------------- Remy Lebeau · 2024-11-03 05:31 Quote from: nightrider43 on November 02, 2024, 02:10:08 pmI have no explanation to justify not having noticed the lack of the 2-dot graphic symbol. The "2-dot symbol" is formally known as a colon.