if ReadString('1Pop3','ServerName','pop3.server.com')='' 
的编译出了问题:
Operator not applicable to this operand type
大概是算符与操作数不一致出了问题。

解决方案 »

  1.   

    ReadString是ini操作吗,代码贴完整看看
      

  2.   


    var
      SQLServerName ,SQLDBName ,Password :string
      tempIni: TIniFile;
    begin
      tempIni :=TIniFile.Create(extractfilepath(ParamStr(0))+'sys.ini');
      SQLServerName := tempIni.ReadString('SYSTEM', 'SERVER', '');
      SQLDBName := tempIni.ReadString('SYSTEM', 'DBNAME', '');
      Password := BlowfishDecrypt(tempIni.ReadString('SYSTEM', 'Password',''));
      tempIni.Free;
    end;
      

  3.   

    代码是这样:
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, IniFiles,Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        Edit1: TEdit;
        Label2: TLabel;
        Edit2: TEdit;
        Label3: TLabel;
        Edit3: TEdit;
        Button1: TButton;
        Button2: TButton;
        Button3: TButton;
        Label4: TLabel;
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      n:integer;
    implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    var
    MailIni:TIniFile;
    begin
    MailIni:=TIniFile.Create(ExtractFilePath(ParamStr(0))+'Mail.ini');
    with MailIni do begin
    if ReadString('1Pop3','ServerName','pop3.server.com')='' or ReadString('1Pop3','ServerUser','your_login')='' ReadeString('1Pop3','ServerPassword','your_password')='' then n=1
    else if ReadString('2Pop3','ServerName','pop3.server.com')='' or ReadString('2Pop3','ServerUser','your_login')='' ReadString('2Pop3','ServerPassword','your_password')='' then n=2
    else if ReadString('3Pop3','ServerName','pop3.server.com')='' or ReadString('3Pop3','ServerUser','your_login')='' ReadString('3Pop3','ServerPassword','your_password')='' then n=3
    else if ReadString('4Pop3','ServerName','pop3.server.com')='' or ReadString('4Pop3','ServerUser','your_login')='' ReadString('4Pop3','ServerPassword','your_password')='' then n=4
    else if ReadString('5Pop3','ServerName','pop3.server.com')='' or ReadString('5Pop3','ServerUser','your_login')='' ReadString('5Pop3','ServerPassword','your_password')='' then n=5
    else if ReadString('6Pop3','ServerName','pop3.server.com')='' or ReadString('6Pop3','ServerUser','your_login')='' ReadString('6Pop3','ServerPassword','your_password')='' then n=6
    else if ReadString('7Pop3','ServerName','pop3.server.com')='' or ReadString('7Pop3','ServerUser','your_login')='' ReadString('7Pop3','ServerPassword','your_password')='' then n=7
    else if ReadString('8Pop3','ServerName','pop3.server.com')='' or ReadString('8Pop3','ServerUser','your_login')='' ReadString('8Pop3','ServerPassword','your_password')='' then n=8
    else if ReadString('9Pop3','ServerName','pop3.server.com')='' or ReadString('9Pop3','ServerUser','your_login')='' ReadString('9Pop3','ServerPassword','your_password')='' then n=9
    else if ReadString('10Pop3','ServerName','pop3.server.com')='' or ReadString('10Pop3','ServerUser','your_login')='' ReadString('10Pop3','ServerPassword','your_password')='' then n=10
    else if ReadString('11Pop3','ServerName','pop3.server.com')='' or ReadString('11Pop3','ServerUser','your_login')='' ReadString('11Pop3','ServerPassword','your_password')='' then n=11
    else if ReadString('12Pop3','ServerName','pop3.server.com')='' or ReadString('12Pop3','ServerUser','your_login')='' ReadString('12Pop3','ServerPassword','your_password')='' then n=12
    else if ReadString('13Pop3','ServerName','pop3.server.com')='' or ReadString('13Pop3','ServerUser','your_login')='' ReadString('13Pop3','ServerPassword','your_password')='' then n=13
    else if ReadString('14Pop3','ServerName','pop3.server.com')='' or ReadString('14Pop3','ServerUser','your_login')='' ReadString('14Pop3','ServerPassword','your_password')='' then n=14
    else if ReadString('15Pop3','ServerName','pop3.server.com')='' or ReadString('15Pop3','ServerUser','your_login')='' ReadString('15Pop3','ServerPassword','your_password')='' then n=15
    else if ReadString('16Pop3','ServerName','pop3.server.com')='' or ReadString('16Pop3','ServerUser','your_login')='' ReadString('16Pop3','ServerPassword','your_password')='' then n=16
    else if ReadString('17Pop3','ServerName','pop3.server.com')='' or ReadString('17Pop3','ServerUser','your_login')='' ReadString('17Pop3','ServerPassword','your_password')='' then n=17
    else if ReadString('18Pop3','ServerName','pop3.server.com')='' or ReadString('18Pop3','ServerUser','your_login')='' ReadString('18Pop3','ServerPassword','your_password')='' then n=18
    else if ReadString('19Pop3','ServerName','pop3.server.com')='' or ReadString('19Pop3','ServerUser','your_login')='' ReadString('19Pop3','ServerPassword','your_password')='' then n=19
    else if ReadString('20Pop3','ServerName','pop3.server.com')='' or ReadString('20Pop3','ServerUser','your_login')='' ReadString('20Pop3','ServerPassword','your_password')='' then n=20
    else   n=21;
    end;
    Label4.Caption:='第'n'页';
    end;end.
    错误提示是这样:
    [Error] Unit1.pas(41): Operator not applicable to this operand type
    [Error] Unit1.pas(42): Operator not applicable to this operand type
    [Error] Unit1.pas(43): Operator not applicable to this operand type
    [Error] Unit1.pas(44): Operator not applicable to this operand type
    [Error] Unit1.pas(45): Operator not applicable to this operand type
    [Error] Unit1.pas(46): Operator not applicable to this operand type
    [Error] Unit1.pas(47): Operator not applicable to this operand type
    [Error] Unit1.pas(48): Operator not applicable to this operand type
    [Error] Unit1.pas(49): Operator not applicable to this operand type
    [Error] Unit1.pas(50): Operator not applicable to this operand type
    [Error] Unit1.pas(51): Operator not applicable to this operand type
    [Error] Unit1.pas(52): Operator not applicable to this operand type
    [Error] Unit1.pas(53): Operator not applicable to this operand type
    [Error] Unit1.pas(54): Operator not applicable to this operand type
    [Error] Unit1.pas(55): Operator not applicable to this operand type
    [Error] Unit1.pas(56): Operator not applicable to this operand type
    [Error] Unit1.pas(57): Operator not applicable to this operand type
    [Error] Unit1.pas(58): Operator not applicable to this operand type
    [Error] Unit1.pas(59): Operator not applicable to this operand type
    [Error] Unit1.pas(60): Operator not applicable to this operand type
    [Error] Unit1.pas(68): Statement expected but end of file found
    [Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
      

  4.   

    还有if ReadString('1Pop3','ServerName','pop3.server.com')='' or ReadString('1Pop3','ServerUser','your_login')='' ReadeString('1Pop3','ServerPassword','your_password')='' then n=1 可能要加括号
    if (ReadString('1Pop3','ServerName','pop3.server.com')='') or (ReadString('1Pop3','ServerUser','your_login')='') 这里少了 or ReadeString('1Pop3','ServerPassword','your_password')='' then n:=1-_-!!! 
      

  5.   


    if MailIni.ReadString('1Pop3','ServerName','pop3.server.com')='' then
      showmessage('读取ini文件,前面加上ini.readstring()');
    {或者是}
      with MailIni do
      begin
      {你的操作!}
      end;
      

  6.   

    程序简化一下:
    with MailIni do 
    begin
      for n := 1 to 20 do
        if (ReadString(IntToStr(n)+'Pop3','ServerName','pop3.server.com') = '') or (ReadString(IntToStr(n)+'Pop3','ServerUser','your_login')='') or (ReadString(IntToStr(n)+'Pop3','ServerPassword','your_password')='') then break;
    end
    Label4.Caption:='第'+IntToStr(n)+'页'; 
      

  7.   

    问题太多了n=21; 这里要n:=21;
    if条件语句中,如果是多条件组合,要用括号
    if (条件1) or (条件2) or (条件3) then
    beginend;