Message de rapport:
 

Re: stocker un champ RTF dans une base (MySQL ou HF)

Sujet: Re: stocker un champ RTF dans une base (MySQL ou HF)
par daniel sur 29/1/2008 23:48:43

C'est simplement qu'il faut remplacer certains caractères dans la chaine.
Voici une exemple de code extrait de c_mysql4wd

v_textstring est une chaîne = la valeur RTF de la chaine

IF (Position(textString, "\") > 0) THEN v_textstring = Replace(v_textstring, "\", "\\")
IF (Position(textString, Charact(0)) > 0) THEN v_textstring = Replace(v_textstring, Charact(0), "\0")
IF (Position(textString, TAB) > 0) THEN v_textstring = Replace(v_textstring, TAB, "\t")
IF (Position(textString, Charact(10)) > 0) THEN v_textstring = Replace(v_textstring, Charact(10), "\n")
IF (Position(textString, Charact(13)) > 0) THEN v_textstring = Replace(v_textstring, Charact(13), "\r")
IF (Position(textString, "'") > 0) THEN v_textstring = Replace(v_textstring, "'", "\'")

v_textstring = "'" + v_textstring + "'"
Connexion
Menu
Chercher WDForge
Chercher Web
Partenaires
Visualiser tous les Partenaires...
WinDev, WebDev, WinDev Mobile et HyperFile sont des marques déposées par PCSoft. |  Voter |  Legal |  Contact |   XOOPS 2.0.13.2