Menu

Could not convert the unit: unexpected token

Alessandro
2005-06-03
2012-07-18
  • Alessandro

    Alessandro - 2005-06-03

    I have read the manual and others documents explaining how to use the DelphiCodetoDoc. However I have tried use without success.

    Error: Could not convert the unit: unexpected token in factor

    Unit Code:

    unit fCFESelecionarAtribuicao;

    interface

    uses
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    FGERALBASEUES, Grids, DBGrids, gridsUES, uBotoesCadEstruturado, StdCtrls,
    StdCtrlsUES;

    type
    TfrmCFESelecionarAtribuicao = class(TfrmGeralBaseUES)
    dgdAssunto: TDBGridUES;
    btnCancelar: TButtonUES;
    btnOk: TButtonUES;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure btnOkClick(Sender: TObject);
    procedure btnCancelarClick(Sender: TObject);
    private
    procedure CarregarGrid;
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    frmCFESelecionarAtribuicao: TfrmCFESelecionarAtribuicao;

    implementation

    uses
    uTiposADOUES, uFormsBase, uTrataErros;

    {$R *.DFM}

    //OK
    procedure TfrmCFESelecionarAtribuicao.FormClose(Sender: TObject;
    var Action: TCloseAction);
    begin
    inherited;
    Action:= cafree;
    end;

    procedure TfrmCFESelecionarAtribuicao.FormShow(Sender: TObject);
    begin
    inherited;
    CarregarGrid;
    end;

    procedure TfrmCFESelecionarAtribuicao.CarregarGrid;
    var
    oAtribuicao : OleVariant;
    rsAtribuicao : ADORecordset;
    begin
    oAtribuicao := CreateInstance('neCFE.EstrutOrgan');
    try
    screen.Cursor := crHourGlass;
    dgdAssunto.ADORecordset := nil;
    rsAtribuicao := ToADORecordset(oAtribuicao.ConsultarAtribuicao(
    VarToStr(StrToInt(Parametro['estrutura'])),
    Integernull));
    dgdAssunto.ADORecordset := rsAtribuicao;
    finally
    screen.Cursor := crDefault;
    oAtribuicao := unassigned;
    end; //finally
    end;

    procedure TfrmCFESelecionarAtribuicao.btnOkClick(Sender: TObject);
    begin
    inherited;
    self.Parametro['estrutura'] := dgdAssunto.valorCampo['CFE_unidade_estrutura_codigo'];
    self.Parametro['assunto'] := dgdAssunto.valorCampo['assunto'];
    self.Parametro['sequencial'] := dgdAssunto.valorCampo['sequencial'];
    self.Parametro['DataHoraAltr'] := dgdAssunto.valorCampo['data_hora_altr'];
    close;
    end;

    procedure TfrmCFESelecionarAtribuicao.btnCancelarClick(Sender: TObject);
    begin
    inherited;
    close;
    end;

    initialization
    RegistrarClasse(TfrmCFESelecionarAtribuicao);

    end.

     
    • TridenT

      TridenT - 2005-06-18

      Well, there is no problem with this file. It parses correctly.
      I think the error come from the file just after, see in the debug window, send it to me please.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.