Silverfrost Logo About Us | Contact Us
 
LOGICAL variables

LOGICAL variables

For example:

LOGICAL xIsNegative
!Code to declare x and give x a value.
xIsNegative=x<0

A logical variable can take one of two states representing true and false. These are represented in programs by:

.TRUE.

.FALSE.

with full stops at the beginning and the end.

For input and output, the edit descriptor Lw is used with logical variables. w is the field width. The output is the letter T (for true) or F (for false), padded with leading spaces. On input only the first character (after optional leading spaces and an optional full stop) is significant. This must be either the letter T or the letter F.

 

 

Copyright © 1999-2017 Silverfrost Limited