test_shape Subroutine

subroutine test_shape()

Arguments

None

Contents

Source Code


Source Code

subroutine test_shape ()
   call lala( 'display(ones(80,1)''*61)')
   call lala( 'help shape')
   call lala( 'tally=[0];')
   call lala( [ character(len=256) :: &
   & 'a=10;b=magic(4);c=ones(11,5);                                            ', &
   & '<X,Y>=shape(c);                                                           ', &
   & 'if X=11,display(''X is 11''),else,display(''X is NOT 11'');X                 ', &
   & 'if Y= 5,display(''Y is  5''),else,display(''Y is NOT  5'');Y                 ', &
   & 'if shape(a)=1,display(''shape of a OK'');tally=[tally,0];else,display(''shape of a BAD'');shape(a),tally=[tally,1];', &
   & 'if shape(b)=[ 4, 4],display(''shape of b OK'');tally=[tally,0];else,display(''shape of b BAD'');shape(b),tally=[tally,1];', &
   & 'if shape(c)=[11,5],display(''shape of c OK'');tally=[tally,0];else,display(''shape of c BAD'');shape(c),tally=[tally,1];', &
   & 'if sum(tally)=0,display(''shape PASSED'');else,display(''shape FAILED'');tally ', &
   & ''])
end subroutine test_shape