How to use the integer function?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

How to use the integer function?

Post by KWiz » Wed Aug 31, 2011 4:41 pm

I've tried several variations of the following script, but cannot figure out how to get the integer portion of a variable.

let>a=65.3
let>b=(int(a))
messagemodal>%b%

What am I doing wrong?

Thanks,
Kwiz

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

Post by JRL » Wed Aug 31, 2011 5:41 pm

Never used "int". I use Separate>.

Code: Select all

let>a=65.3 
Separate>a,.,res
MDL>res_1

KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Post by KWiz » Wed Aug 31, 2011 6:14 pm

Awesome, thanks!

Kwiz

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

Post by JRL » Wed Aug 31, 2011 6:37 pm

Code: Select all

let>a=65.9
let>b={int(%a%)}
messagemodal>%b%
I couldn't let it go. HAD to figure out how this worked.

Basically, all complex expressions have curly braces outside and parenthesis inside. Also to resolve a variable in a complex expression requires the variable be enclosed in percents.

KWiz
Junior Coder
Posts: 30
Joined: Sat Oct 07, 2006 1:43 pm

Post by KWiz » Thu Sep 01, 2011 1:46 am

lmao... thanks!

Kwiz

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