Recent

Author Topic: Problem with LineEnding in DBMemo  (Read 5500 times)

ajosifoski

  • Jr. Member
  • **
  • Posts: 55
Problem with LineEnding in DBMemo
« on: April 17, 2009, 05:48:45 pm »
Hi

I want my application to create dbf and dbt files which can be edited both in linux & windows. But have problems...

DBMemo are stored in dbt. So when edited on windows there is no problem to see how it looks like in linux. But when created/edited in linux, on windows Carriage Returns are squares.

Help?

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Problem with LineEnding in DBMemo
« Reply #1 on: April 17, 2009, 07:06:04 pm »
Are you sure you are using the same character set - to me it sounds like you are using ISO-ANSI on the windows machine, and UTF-8 on the Linux.

Also you have to remember that Windows and *nix interprets newline differently, Windows normally uses CR+LF, whereas *nix only uses LF (but the CR makes no harm).

/Christian

ajosifoski

  • Jr. Member
  • **
  • Posts: 55
Re: Problem with LineEnding in DBMemo
« Reply #2 on: April 20, 2009, 06:43:27 pm »
Well I solve problem with some coding

Code: [Select]
...
var st:string;
...
     if Dbf1.FieldValues['Question'] <> null then
     st:=Dbf1.FieldValues['Question']
     else st:=' ';
     for i:=length(st) downto 1 do
     if (st[i]=#10) and (st[i-1] <> #13) then insert(#13, st, i);
     Dbf1.FieldValues['Question']:=st; 
...

And put that code before closing application, on TForm1.OnClose event.
I use TDBF. How can I reference TDBImage from Controls with some DB. It don't have to be TDBF.
Can I make connection to OpenOffice Base .odb with Lazarus?

ajosifoski

  • Jr. Member
  • **
  • Posts: 55
Re: Problem with LineEnding in DBMemo
« Reply #3 on: April 21, 2009, 07:01:08 pm »
I use TDBF. How can I reference TDBImage from Controls with some DB. It don't have to be TDBF.
Can I make connection to OpenOffice Base .odb with Lazarus?

Problem solved again.
Using ftBLOB when defining Dbf file. Then DBImage can be conected with it, and pictures can be put in dbt file with Dbf1.Picture.LoadFromFile

 

TinyPortal © 2005-2018