Save richedit to field

Save richedit to field

Postby Marc Vanzegbroeck » Sat Jul 27, 2019 9:54 am

Hi,

I want to edit a text in richedit, and than save it to a database field.
Later I want to be able to edit again, but I cound wake it work.

I get the text with
Code: Select all  Expand view
vtext = oRich:SaveAsRTF


Than save it
Code: Select all  Expand view
repl tekstlengt with HB_CompressBuflen( Len( vtext ) )
repl tekst      with HB_Compress( vtext )

for users with SQL than I do a replace with "'0x"+STRTOHEX( tekst )


But when I want to read it back with HB_Compress() , the text is empty.

I use this method also for other things, and that is working.
How can I set the text back into the richedit?

I use oRich:LoadRTF( tekst ), but it's not working
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Save richedit to field

Postby Marc Vanzegbroeck » Sat Jul 27, 2019 10:52 am

I solved the problem.
I had to do a hextostr() when reading back the info
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests