# increment and decrement

## Recommended Posts

After using these forums for quit some time I've come across a question that I can't find the answer to. The following code works for me but I need it to inc/decrement by 25. Can someone help me with this?(L:APNHgt, feet) -- d 50 < if{ 50 } (>L:APNHgt, feet)(L:APNHgt, feet) ++ d 300 > if{ 300 } (>L:APNHgt, feet)

##### Share on other sites
 Help AVSIM continue to serve you!Please donate today!

The operator ++ always increments by one.So:(L:var,feet) ++ (>L:var,feet)is idendical to(L:var,feet) 1 + (>L:var,feet)If you want to increment each click with 25, use:(L:var,feet) 25 + (>L:var,feet)SImularly, use(L:var,feet) 25 - (>L:var,feetto decrement with 25.Cheers, Rob Barendregt

##### Share on other sites

I needed to retain the minimum and maximum numbers that are in the code.This is how I solved it. Works fine.;(L:APNHgt, feet) 25 - d 50 < if{ 50 } (>L:APNHgt, feet)(L:APNHgt, feet) 25 + d 300 > if{ 300 } (>L:APNHgt, feet)

## Create an account

Register a new account

• Tom Allensworth,
Founder of AVSIM Online

• ### Hot Spots

• Flight Simulation's Premier Resource!

AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!