How to Return the Exponent

scott at elementarysoftware.com scott at elementarysoftware.com
Wed Dec 18 05:02:40 EST 2024


Roger, I don’t believe that setting the itemDel will change how WORDs break. It will allow you to find ITEM 2:

 ^1/x) 

I was getting char 3 of item 2 and that would work as long as x was a single digit (which you implied originally) but Bernd’s solution is more robust (as usual!) because it will find an x that contains 1 or more digits.

That is a better solution than using “char” 

> On Dec 18, 2024, at 12:59 AM, Niggemann, Bernd via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi Roger,
> 
> This does work:
> 
> Please note the quotes, in your mail it was curly quotes that do not work apart from asking for "word" instead of "token".
> 
> on mouseUp
>   set the itemDel to "^"
>   put token 3 of item 2 of "((1234…)^1/x)" into field 1
> 
>   set the itemDelimiter to "/"
>   put cr & token 1 of item 2 of  "((1234…)^1/15)" after field 1
> end mouseUp
> 
> Kind regards
> Bernd
> 
>> Roger wrote:
> 
>> Oops. I take it back. It does not work.
>> set the itemDel to “^"
>> put char 3 of word 2 of "((1234…)^1/x)”
>> returns blank
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list