Problem using delphi Tmemo with Oracle 
Author Message
 Problem using delphi Tmemo with Oracle

Hi,
I have an application using Tmemo to allow the users to enter/modify a
block of text.  Text can be load from file using LoadFromFile method.
The text is stored in Oracle LONG field. Field value is assigned using
FieldByName('TEXT').Assign(Tmemo.lines) befor posting.

Problems are:
1. delphi adds line feed and carriage return to the end of each line,
though no hard returns were used.

2. Since Lines property in Tmemo is a Tstrings, each line is limited to
255 characters.  It truncates everything after 255 characters on each
line when loading text from a file.

Is there a way to save the text without extra line feed and carriage
return?

Is there a better component then Tmemo for text editing?



Sun, 26 Jul 1998 03:00:00 GMT  
 Problem using delphi Tmemo with Oracle


^ you should take a look at your newsreader config! And since you didn't
include a signature your email address is completely lost.

: I have an application using Tmemo to allow the users to enter/modify a
: block of text.  Text can be load from file using LoadFromFile method.
: The text is stored in Oracle LONG field. Field value is assigned using
: FieldByName('TEXT').Assign(Tmemo.lines) befor posting.
So the field is a TMemoField for Delphi? Then the best way to pass the memo
contents to the memofield is to use streams - you load the text into a pchar
using the gettextbuf method of the tmemo and then pass this into something
like
BS:=TBlobStream.Create(yourmemofield,bmwrite); BS.Write(yourpchar); BS.Free;

: Problems are:
: 1. delphi adds line feed and carriage return to the end of each line,
: though no hard returns were used.
In that case you should set the wordwrap property to false, so only the real
hard return survive. But this makes problem 2 worse since the lines are more
likely longer than 255 chars.

: 2. Since Lines property in Tmemo is a Tstrings, each line is limited to
: 255 characters.  It truncates everything after 255 characters on each
: line when loading text from a file.
The only way to avoid this is to use something else then strings, and there
pchars are the only alternative.

: Is there a better component then Tmemo for text editing?
There certainly is - look the Delphi Superpage and I guess you'll find at
least some shareware components for this.

Hope that helps,
    Andy

--
----------------------------------------------------------------------------
Andreas H"orstemeier                       | This Signature is Shareware


fido:     2:2444/4505.3                    |
astronet: 122/490/1.53                     |
----------------------------------------------------------------------------  


Mon, 27 Jul 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ask: Oracle Memo fields and Delphi TMemo component

2. Problem using delphi with ORACLE public synonyms

3. Problem using Delphi with ORACLE string field

4. Using Delphi Oracle 7 drivers on Oracle 8

5. Delphi 2:Problems with TMemo from MS-SQL Server

6. Personal Oracle 7.2 Win95/Oracle ODBC/Delphi 2.0 Problems

7. Oracle & TMemo

8. Need Help on Writing contents of a TMemo Using SQL

9. problem to solve using numbers in delphi (using Val() and FloatToStrF() )

10. Delphi2 and Delphi4 problems using TBatchMove with ORACLE 8

11. problem selecting BLOBs using RequestLive, Oracle 7.3.3, BDE 3.51, D2

12. Using UDF's in Oracle PROBLEM!!

 

 
Powered by phpBB® Forum Software