|

How do I... ?

AnswerList of Questions


Round a Number Up or Down


If you want all fractions to round up (e.g. 2.1 -> 3.0, 2.5 -> 3.0) then use Math.Ceil. (See Round a number up.)


If you want all fractions to round down (e.g. 2.1 -> 2.0, 2.5 -> 2.0) then use Math.Floor. (See Round a number down.)


If you want anything equal to or above ".5" to round up, and anything below ".5" to round down (e.g. 2.1

-> 2.0, 2.5 -> 3.0), use the following action:


n = 2.5;

rounded = Math.Round(n);


image

image

How do I... ?

AnswerList of Questions


Run a Program and Wait for it to Finish


Using AutoPlay Media Studio, you can launch an executable file, and have your application wait until that executable file exits.


image

As an example we will run the executable example.exe, and have the application wait until example.exe is closed. This is accomplished by using the File.Run action, and setting the WaitForReturn property to true:


File.Run("c:\\example.exe", "", "", SW_SHOWNORMAL, true);


Note: This action will launch example.exe, and wait until example.exe is terminated.


image

image

|