LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
RossG
- Posts: 247
- Joined: Thu Jan 08, 2015 7:38 am
Post
by RossG » Fri Jun 10, 2016 1:48 pm
I have:
Code: Select all
repeat with x = 16 to min(36,sCount)
put max(field ("R" & x),field ("B" & x)) into maxVar
put min(field ("R" & x),field ("B" & x)) into minVar
if round(maxVar/minVar,2) > mPerCent then
put round(maxVar/minVar,2) into mPerCent
---
end if
end repeat
In the line "---" I want to get the name of the field
containing the max value.
No prize for the correct answer but lots of gratitude from
a tired old brain.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
-
dave.kilroy
- VIP Livecode Opensource Backer

- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
-
Contact:
Post
by dave.kilroy » Fri Jun 10, 2016 3:37 pm
Hi - the following appears to work (the field name you want is in 'tMax & x') but it does make other changes to your code...
Code: Select all
repeat with x = 16 to min(36,sCount)
if fld ("R" & x) > fld ("B" & x) then put "R" into tMax else put "B" into tMax
put round(fld (tMax & x)) into maxvar
put min(field ("R" & x),field ("B" & x)) into minVar
if round(maxVar/minVar,2) > mPerCent then
put round(maxVar/minVar,2) into mPerCent
---
end if
end repeat
Note: this doesn't allow for occasions where fld ("B" & x) is equal to fld ("R" & x)
"...this is not the code you are looking for..."
-
RossG
- Posts: 247
- Joined: Thu Jan 08, 2015 7:38 am
Post
by RossG » Mon Jun 13, 2016 11:28 pm
Thanks Dave.
I like min and max. Both remind me of people.
Minnie was my mothers middle name - well, it was 1912.
Although Minnie Driver doesn't seem to suffer from it.
Max was just funny. That was around 1950. Don't
expect that he's very funny these days.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.