Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

[Error] Unit1.pas(38): Type of expression must be BOOLEAN

Collapse
X
 
  • Filter
  • Tempo
  • Show
Clear All
new posts

  • Continaçon
    replied
    Postado Originalmente por gothie Ver Post
    troque a linha,
    Código HTML:
    if (dialogAbrir) then
    por
    Código HTML:
    if (dialogAbrir.Execute) then
    que vai funcionar! "if (dialogAbrir) then" nao retorna um valor boolean por isso nao funciona.
    Obrigado, funcionou ^-^

    Leave a comment:


  • gothie
    replied
    Postado Originalmente por Continaçon Ver Post
    Estou tentando abrir um arquivo txt no delphi, porém, quando compilo dá esse erro "



    Por quê está dando esse erro e como resolve-lo?
    troque a linha,
    Código HTML:
    if (dialogAbrir) then
    por
    Código HTML:
    if (dialogAbrir.Execute) then
    que vai funcionar! "if (dialogAbrir) then" nao retorna um valor boolean por isso nao funciona.

    Leave a comment:


  • [Error] Unit1.pas(38): Type of expression must be BOOLEAN

    Estou tentando abrir um arquivo txt no delphi, porém, quando compilo dá esse erro "

    [Error] Unit1.pas(38): Type of expression must be BOOLEAN" eis o código do programa:

    procedure TForm1.btnAbrirClick(Sender: TObject);
    var
    arquivo: TextFile;
    LinhasArq: String;
    begin
    memoTexto.Clear;
    if (dialogAbrir) then
    if (dialogAbrir.FileName <> '') then
    begin
    editAbrir.Text := dialogAbrir.FileName;
    AssignFile(arquivo,dialogAbrir.FileName);
    Reset(arquivo);
    While Not (Eof(arquivo)) do
    begin;
    Readln(arquivo,linhasArq);
    memoTexto.Lines.Add(linhasArq);
    end;
    CloseFile(arquivo);

    end;
    end;

    end.
    Por quê está dando esse erro e como resolve-lo?
X
Working...
X