DECR

Top  Previous  Next

Action

Decrements a variable by one.

 

 

Syntax

DECR var

 

 

Remarks

Var

Variable to be decremented.

var :  Byte, Integer, Word, Long, Single.

 

There are often situations where you want a number to be decreased by 1.

The DECR statement is faster then var = var - 1.

 

 

See also

INCR

 

 

Example

'--------------------------------------------------------------

'                     (c) 1995-2006 MCS Electronics

'--------------------------------------------------------------

'  file: DECR.BAS

'  Demo: DECR

'--------------------------------------------------------------

Dim A As Byte

 

A = 5                                   'assign value to a

Decr A                                 'decrease (by one)

Print A                                 'print it

End