On 2/11/19 6:58 PM, Roger Guay via use-livecode wrote:
Granted, this may be too esoteric for me to understand, but I can’t seem to 
make this do what I want to do

Let’s say that I have 3 globals: gGlobal1 = 10.1, gGlobal2 = 20.2 and gGlobal3 
= 30.3

I have an expression like       gGlobal1*gGlobal2/gGlobal3

I want to transform this to the expression     10.1*20.2/30.3.

Seems simple enough and I can do it in my usual inelegant way, but there must 
be a simpler way to do this???

Sorry for my confusion.

Monte's reply seems to do the job, but if you're concerned about the numeric format, try

on mouseUp
   put 10.1 into gGlobal1
   put 20.2 into gGlobal2
   put 30.3 into gGlobal3
   put format("%2.1f*%2.1f/cos(%2.1f)", gGlobal1, gGlobal2, gGlobal3)
end mouseUp

or just chang that last line to
   put format("%s*%s/cos(%s)", gGlobal1, gGlobal2, gGlobal3)
if you *really* don't care about the format

--
 Mark Wieder
 ahsoftw...@gmail.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to