trichview.com

trichview.support




Re: unicode encoding


Return to index


Author

Message

Richard Caruana

Posted: 02/07/2005 10:05:16


As I do not have RVGetTextW.dcu I changed this to RVGetText for my uses clause

I hope this was alright otherwise you will need to send me a copy of

RVGetTextW.dcu



The follwing errors occur when I try to compile my code follows :-


any help is appreciated

(I really don't know why Table is undeclared I added a datasource and linked it

to table object, and I added a table object to the project.

I renamed the table1 object to 'Table' and I made it active and linked it to

dictionary.db)


[Warning] EditorFrame.pas(521): Variable 'Wrap' might not have been initialized


[Error] EditorFrame.pas(675): Undeclared identifier: 'Table'

[Error] EditorFrame.pas(676): Undeclared identifier: 'Stream'

[Error] EditorFrame.pas(677): Missing operator or semicolon

[Error] EditorFrame.pas(678): '(' expected but identifier 'Stream' found

[Error] EditorFrame.pas(679): Not enough actual parameters

[Error] EditorFrame.pas(699): Undeclared identifier: 'RVGetTextW'

[Error] EditorFrame.pas(699): ')' expected but identifier 'GetAllText' found

[Error] EditorFrame.pas(699): 'END' expected but ')' found

[Error] EditorFrame.pas(703): '.' expected but ';' found

[Fatal Error] DualEditor7.dpr(9): Could not compile used unit 'EditorFrame.pas'





uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  FileView, JWEdit, JWCtrls, ComCtrls, ToolWin, ExtCtrls, ImgList, Menus,

  StdCtrls, TextBuff, rbBase, rbDS, rbTable, rbMatch, rbCache, rbSearch,

  rbLogic, rbRank, rbPrgDlg, rbBits, rbConst, RVScroll, RichView, RVStyle,

  Db, DBTables, RVGetText, RVFMisc;


  the following code is at end of project:-


function LoadRVFFromField(rv: TRichView; tbl: TDataSet;

                          const FieldName: String): Boolean;

var Stream: TStream;

begin

  Stream := tbl.CreateBlobStream(tbl.FieldByName(FieldName), bmRead);

  try

    Result := rv.LoadRVFFromStream(Stream);

  finally

    Stream.Free;

  end;

  rv.Format;

end;


procedure SaveTextToField(const s: String; tbl: TDataSet;

                          const FieldName: String);

begin

  Table.Edit;

  Stream := tbl.CreateBlobStream(tbl.FieldByName(FieldName), bmWrite);

  Stream.WriteBuffer(PChar(s)^, Length(s));

  delete Stream;

  table.Post;

end;





procedure TFrame2.Button3Click(Sender: TObject);

begin

         EditWords.Show;

end;


procedure TFrame2.Button4Click(Sender: TObject);

begin

Table.First;

while not table.Eof do

begin

  LoadRVFFromField(rv, table, 'french');

  // GetAllText() is defined in the unit RVGetTextW.

  // Do not use here the function with the same name

  // from RVGetText unit!

  SaveTextToField(RVEncodeWidestring(RVGetTextW.GetAllText(rv)),

    table, 'frenchUTF');

  table.Next;

end;

end;


end.





Powered by ABC Amber Outlook Express Converter