FORTRAN 77 Language Reference

Example


       CHARACTER S*6, T*6 
       INTEGER V(3)*4 
       DATA S / '987654' / 
       DECODE( 6, 1, S ) V 
1      FORMAT( 3 I2 ) 
       ENCODE( 6, 1, T ) V(3), V(2), V(1) 

The DECODE reads the characters of S as 3 integers, and stores them into V(1), V(2), and V(3). The ENCODE statement writes the values V(3), V(2), and V(1), into T as characters; T then contains '547698'.

See "DECODE/ENCODE" for more information and a full example.