Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Tarak on May 09, 2008, 05:34:31 AM

Title: Easy way to always have a positive value in a DRO field
Post by: Tarak on May 09, 2008, 05:34:31 AM
Is there an easy way to always force a positive value into a DRO, I have a small calculator I've made for working out a lead (similar to a drill flute), it works great but it returns a negative value.
Is it possible to change the following line to make it always output a positive value?

SetOEMDRO (1203,3.141592654*Ø/Tan(AngleinRadians)) 'This normally works out to a negative value, but the value in a positive is correct.
Title: Re: Easy way to always have a positive value in a DRO field
Post by: poppabear on May 09, 2008, 08:30:35 AM
Yes,

x=ABS(SetOEMDRO (1203,3.141592654*Ø/Tan(AngleinRadians)))

Absoulte value function, always positive.

scott
Title: Re: Easy way to always have a positive value in a DRO field
Post by: Tarak on May 09, 2008, 04:57:58 PM
Yet again, Thanks scott, works well. Now that I look at the function Abs, I think you may of told me this once before, sorry.
Darc