I am developing an app that is basically the front end to a sqlite database. At times I would like to put links to web content into the text of LC fields such that when I update the corresponding database field, the links are preserved, i.e., when the script retrieves the text from the database the links are still there. From the LC user guide I see signs that urlencode and urldecode can be used for this , but I would like some confirmation that my objective can be done with these commands before I deep deeper into the details. Can this be done with LC scripts? If so, is there any tutorial or forum discussion on the technique? Thanks for any tips.
Monty May
Keeping links in sqlite
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Keeping links in sqlite
Hi Monty,
not sure I understand your problem, but can't you use and store "the htmltext of fld xyz"?
That way LINKS would be preserved.
But maybe I really don't get it!?
Best
Klaus
not sure I understand your problem, but can't you use and store "the htmltext of fld xyz"?
That way LINKS would be preserved.
But maybe I really don't get it!?

Best
Klaus
Re: Keeping links in sqlite
Hi Klaus,
Thank you for your response. Although my primary interest is hyperlinks in the text, as a test, I put word "abc" into field "xyz", styled it bold, using the menu command, and then used your command, i.e., "put the htmltext of fld "xyz" into a variable, and then used the query "UPDATE myTable SET . . . etc. Both the text in the db table and the returned text in field "xyz" read: <p><b>abc</b></p>. Pardon me if am following up on your your tip too soon without first further studying the use of htmltext, but perhaps you could point out an obvious omission on my part. Is it that a subsequent script needs to manipulate the variable before commiting it to the database and again when retrieving the data from the database? Also, when using link-style text, the urlencode/decode functions are not necessary?
Monty May
Thank you for your response. Although my primary interest is hyperlinks in the text, as a test, I put word "abc" into field "xyz", styled it bold, using the menu command, and then used your command, i.e., "put the htmltext of fld "xyz" into a variable, and then used the query "UPDATE myTable SET . . . etc. Both the text in the db table and the returned text in field "xyz" read: <p><b>abc</b></p>. Pardon me if am following up on your your tip too soon without first further studying the use of htmltext, but perhaps you could point out an obvious omission on my part. Is it that a subsequent script needs to manipulate the variable before commiting it to the database and again when retrieving the data from the database? Also, when using link-style text, the urlencode/decode functions are not necessary?
Monty May
Re: Keeping links in sqlite
Hi Monty,
hm, looks like I still have no actual idea what exactly you are trying to achieve...
"the htmltext of ld xyz" returns the FORMATTED text of htat filed, and that means formatted via HTML tags, as you can see.
See it as the SOURCE of a html formatted webpage.
"the text of fld xyz" would simply return "abc" in your example.
And since LINKS will be kept in HTMLTEXT I thought that would be the way to go for you.
But what do you mean by:
Maybe you should post the script that will "manipulate" the text to your needs, so I get an idea.
Maybe "urlencode/decode" depends on that.
Best
Klaus
hm, looks like I still have no actual idea what exactly you are trying to achieve...
"the htmltext of ld xyz" returns the FORMATTED text of htat filed, and that means formatted via HTML tags, as you can see.
See it as the SOURCE of a html formatted webpage.
"the text of fld xyz" would simply return "abc" in your example.
And since LINKS will be kept in HTMLTEXT I thought that would be the way to go for you.
But what do you mean by:
Is it that a subsequent script needs to manipulate the variable before commiting it to the database and again when retrieving the data from the database?
Maybe you should post the script that will "manipulate" the text to your needs, so I get an idea.

Maybe "urlencode/decode" depends on that.
Best
Klaus
Re: Keeping links in sqlite
@montymay, the htmltext is always plain ascii and needs no manipulation. What you're missing is how to get the text back into the field after retrieval. For that you use "set the htmltext of field x to <variable>".
Do read about htmltext in the dictionary. The text of fields can be stored in several formats, html is only one of them.
Do read about htmltext in the dictionary. The text of fields can be stored in several formats, html is only one of them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com