Math Functions

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Math Functions

Post by mightycpa » Wed Mar 10, 2021 6:05 pm

Occasionally, in the forum I run across posts that include code like

Code: Select all

Let>v_one={INT(123.45)}

Let>v_two={MOD(123/45)}
But I can never find a comprehensive list of commands available to use. Is there a link? Is it in the manual somewhere?
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Math Functions

Post by JRL » Wed Mar 10, 2021 7:22 pm


mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Math Functions

Post by mightycpa » Wed Mar 10, 2021 7:39 pm

You'd think, amirite?

But you'll notice on that page there's an INT but no MOD. And yet, MOD works. It stands to reason then that there might be more. Today, I'm looking for a MAX() function (doesn't work), but I think it would be really handy if that page was comprehensive. Maybe it almost is.

I'm just asking.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Re: Math Functions

Post by Bob Hansen » Thu Mar 11, 2021 7:02 pm

I think mod is actually an operator, not a function. The operators perform operations among two or more numbers. A function may just display a single number in a different view.

And I agree, a MOD, MIN, MAX set of functions, with Command Help would be nice.
I am surprised that they do not exist in the Excel Functions, a natural location.

In the meantime, we can use ArrayCount with ArraySort to find the Min/Max value.

Code: Select all

//Put the values into an array.
ArrayDim>vScore,3
Let>vScore_1=95
Let>vScore_2=73
Let>vScore_3=88

//Count the items in the array
ArrayCount>vScore,vCount

//Sort the array to Min-Max result
ArraySort>vScore

//Grab the Min/Max values
Let>vMin=vScore_1
Let>vMax=vScore_%vCount%

//Display the results
MessageModal>%CRLF%Minimum score is %vMin%%CRLF%Maximun score is %vMax%[code]
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

mightycpa
Automation Wizard
Posts: 343
Joined: Mon Jan 12, 2004 4:07 pm
Location: Vienna, VA

Re: Math Functions

Post by mightycpa » Thu Mar 11, 2021 7:06 pm

Hi Bob, yeah, that's pretty much what I had to do.

Did you ever run the two GFL programs? Not sure if you noticed, but I used the Samples folder under MS in that video. You've already got those files.

I don't have any email generated files at the moment.
"A facility for quotation covers the absence of original thought." - Lord Peter Wimsey

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Re: Math Functions

Post by Bob Hansen » Tue Mar 16, 2021 2:17 am

Ooh, sorry. I got caught up in something new, and forgot to do that.

I had only downloaded the GFL14 because I thought they were code for different versions. But in one of your last messages, you told me they were files showing how 14/15 gave different results. I will try to look at that again, in next few days. Thanks for the reminder.
------------------------------
Re the emails. They don't need to be current. You must have some old email in a Trash folder that you can SAVE AS. I am just interested in the file format, some internal stuff that may be there, and especially the file naming convention. I don't know if different email clients do a Save Email with the same results. I would love to rule that out, that is why I want testing with what YOU are actually creating.

OOPs, I think we just hijacked this topic. Will be sure to put comments on GFL in the right forum.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts