Subtract

Item Description

Use with:

Startup scripts, Terminal Launcher, Web, Windows

SecureLogin Version:

3.0

Type:

Variable manipulator

Usage:

Subtract Start-Value Subtract-Value [?Result]

Arguments:

Start-Value



Subtract-Value

[?Result]

The start number that the second argument will be subtracted from. This argument will contain the result if the optional [?Result] argument is not passed in.

If you use the Start-Value argument without the [?Result] argument, Start-Value must be a SecureLogin variable (for example, ?Start-Value or $Start-Value). If the [?Result] argument is provided, Start-Value can be a SecureLogin variable or a numeric value.

The number that will be subtracted from the first argument. Subtract-Value can be a SecureLogin variable or a numeric value.

Optional. The result of the equation. If you use this argument, set it to Start-Value - Subtract-Value. The [?Result] must be a SecureLogin variable (for example, $Result or ?Result).

Description:

Subtracts one value from another. This can be useful if you are implementing periodic password change functionality for an application. The subtract command (in conjunction with the Divide function and the slinac .dll file) can be used to determine the number of days that have elapsed since the last password change.

The Subtract command correctly subtracts when Start-Value, Subtract-Value, and Result are between -2147483648 and +2147483647.

Subtract doesn't work with fractions.

Syntax Examples:

Subtract "1" "2" ?Result
Subtract ?LoginAttempts ?LoginFailures
Subtract ?LoginAttempts ?LoginFailures ?Result
Subtract ?LoginAttempts "3"
Subtract ?LoginAttempts "3" ?Result

Example:
Windows Script

The values of Control IDs 103 and 104 are read into variables. From there they are subtracted and typed into Control ID 1.

ReadText #103 ?Number1 
ReadText #104 ?Number2
Subtract ?Number1 ?Number2 ?Result
Type ?Result