Functions

Logical functions

Function
Description
Example
iif(condition, arg1, arg2)
Immediate If. Returns arg1 if condition is true or arg2 if condition is false.
iif($[invoices:overdue]="Yes", "Pay now", "This can wait")

Date and time functions

Function
Description
Example
DateTime.Now
Returns the current date and time.
DateTime.Now
DateTime.Today
Returns the current date.
DateTime.Today
DateTime.DaysInMonth
Returns the number of days in a month.
DateTime.DaysInMonth(2008, 2)
You can use all the methods and properties of the System.DateTime class.
Visit msdn.microsoft.com and search for ‘System.DateTime for more information.

Mathematical functions

Function
Description
Example
Abs
Returns the absolute (positive) value of a specified number.
Abs( -3 )
Round
Returns the whole number nearest the specified value.
Round( 10.2554 )
Ceiling
Returns the smallest whole number greater than or equal to the specified number.
Ceiling of 6.2 is { Ceiling( 6.2 ) }
Floor
Returns the largest whole number less than or equal to the specified number.
Floor of 4.7 is { Floor( 4.7 ) }
Min
Returns the smaller of two numbers.
Min( 2, 5 )
Max
Returns the larger of two specified numbers.
Max( 5, 2 )
You can use all the methods and properties of the System.Math class.
Visit msdn.microsoft.com and search for ‘System.Math’ for more information.

System functions

Function
Description
Example
Environment.UserName
Returns the name of the user that is running variaDoc
Current user is { Environment.UserName }
Environment.MachineName
Returns the name of the computer that is running variaDoc
Current PC name is { Environment.MachineName }
You can use many of the classes in the System assembly of .NET, including the base types like Double, Int32, String, DateTime etc. It is however not currently supported to use other namespaces or assemblies. Visit msdn.microsoft.com and search for ‘System namespace’ for more information on the classes available in the System namespace.