Using Superscript and Subscript in Fields
curry
curry at pair.com
Sat Jun 7 05:21:00 EDT 2003
>The problem is preventing the search and replace from picking up the
>next number which should remain as normal text. 1s^2 2s^2 2p^6 and so
>on. By placing a space between each subshell configuration I think it
>would work.
Actually, it's easy to do this kind of thing once you learn
scripting. Here's an example doing a repeat, although a regEx
replacement should be possible too. You could adjust it if anything
is not quite the way you want:
function theformat x
repeat for each word w in x
put char 1 of w & "<i>" & char 2 of w & "</i>" \
& "<font size=8><sup>" \
& char 3 of w & "</sup></font>" \
& space after r
end repeat
delete last char of r
return r
end theformat
Then you can set the htmltext of your field to theformat(whatever you give it).
You might want use a font size of 8 or more, I had unexpected results
with smaller sizes.
--
Curry Kenworthy
--
Christian xTalk discussion list
http://groups.yahoo.com/group/cxtalk/
More information about the use-livecode
mailing list