Using Superscript and Subscript in Fields

Jim Hurley jhurley at infostations.com
Fri Jun 6 19:58:00 EDT 2003


>
>--__--__--
>
>Message: 4
>Date: Thu, 5 Jun 2003 00:12:56 -0400
>Subject: Using Superscript and Subscript in Fields
>From: Paul Charlesworth <pcharles at chartermi.net>
>To: use-revolution at lists.runrev.com
>Reply-To: use-revolution at lists.runrev.com
>
>Hello All:
>
>I would like to represent the electron configuration of elements using
>superscript and subscripts and would like to know what the best
>approach my be. So far, I have the following approach working, but the
>superscripted text is not a smaller font size as it should be:


Superscripting and subscripting of text is something I use regularly. 
And so I have written a parser which takes text in one field, using 
the carrot to denote a superscript and tilde to denote a subscript 
and formats this text in another field.

For example, the equation:

x^2 + y^2 = z^2

would be formatted with the squares as superscripts, reduced in font 
size. You can use a combo such as x^1~2 which would format as x super 
1 sub 2.

I have put the stack on my web site (control-click to download) 
http://home.infostations.net/jhurley/

There are two situations I haven't worked out.

The program need to recognize a delimiter to denote the end of the 
sub/superscript. Such common delimiter area: comma, period, and 
space. (In the above equation, a space appears after each 
superscript, *except* the last--end of line.

But I haven't been able to  include "return" or just the end of the 
field. Anyone????

The line that needs fixing is:

  repeat until char tNum+1+j of field 1 is in quote & " " & "," & "." 
& quote then

How do I get a "return" and end of field into this--between the quote pair?

Jim




More information about the use-livecode mailing list