Bullit Points

Devin Asay devin_asay at byu.edu
Fri Mar 2 18:33:05 EST 2007


Cal,

On Mar 2, 2007, at 3:08 PM, Cal Horner wrote:

> has anyone in the list been successful in putting bullet points  
> into text
> fields?

I'm not sure if you're asking how to format the field or how to show  
the bullet character. Maybe this will help.
>
> If so could you explain how you did this?

A while back I was experimenting with processing HTML code and  
displaying it in fields (more robustly than Rev does natively.) I  
came up with the following snippet for replacing unordered list  
(<OL>) tags up to six nested levels. I had previously parsed through  
the HTML and figured out how deeply the <LI> tags were nested,  
temporarily replaced the LI tags with Ln, then replaced those with  
HTML encoded strings that included embedded unicode escape codes to  
represent the bulleted items in the lists.

   -- replace <li> tags with appropriate bullets
   put "  " into padSp
   put "<font face=" & quote & "Osaka" & quote & " lang=" & quote &  
"ja" & quote & ">•</font> " into lev1Bullet
   put "<font face=" & quote & "Osaka" & quote & " lang=" & quote &  
"ja" & quote & ">◦</font> " into lev2Bullet
   put "<font face=" & quote & "Osaka" & quote & " lang=" & quote &  
"ja" & quote & ">▪</font> " into lev3Bullet
   replace "<l1>" with "<P>"&padSp&lev1Bullet in fixedHTML
   replace "<l2>" with "<P>"&padSp&padSp&lev2Bullet in fixedHTML
   replace "<12>" with "<P>"&padSp&"1. " in fixedHTML
   replace "<l3>" with "<P>"&padSp&padSp&padSp&lev3Bullet in fixedHTML
   replace "<l4>" with "<P>"&padSp&padSp&padSp&padSp&lev1bullet in  
fixedHTML
   replace "<l5>" with "<P>"&padSp&padSp&padSp&padSp&padSp&lev1bullet  
in fixedHTML
   replace "<l6>" with  
"<P>"&padSp&padSp&padSp&padSp&padSp&padSP&lev1bullet in fixedHTML

Once all of the replacements were made I set the htmltext of the  
display field to fixedHTML.

Kinda ugly, I know, but it was an interesting exercise.

HTH

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list