Why fortran90 aren't a case with non-constant argument?
I known that C/C++ haven't it, too. But is easy for the
implementation for developpers. ( I think !)
integer :: ndx;
integer :: U_;
integer :: V_;
integer :: W_;
U_= 1; V_ = 2; W_ = 3;
read(*,*) ndx;
..............................................
SELECT CASE(ndx)
CASE(U_); call CalculateU();
CASE(V_); call CalculateV();
CASE(W_); call CalculateW();
CASE DEFAULT; call Msg_Error();
END SELECT
____________________________________________________________________________
Miguel Murillo Condon Area de Mecanica de Fluidos
[log in to unmask] Centro Politecnico Superior
c/ Maria de Luna,3
50015 Zaragoza, SPAIN
tel.: +34-976-761000 ext. 5052
Fax: +34-976-761882
____________________________________________________________________________
Because the theoretical algorithmic schema of the CASE is the CHOICE of a
treatment according to the value of a (discrete)value (your NDX here)
in a predefined subset of a discrete set (here the INTEGER set).
Yours sincerely,
---------------------------------------------------------
* Patrice LIGNELET *
* Tel: 01 40 27 23 83 Fax: 01 40 27 23 77 *
* 22 58 (Secretariat) *
* Courriel: [log in to unmask] *
* Sur la Toile mondiale (le Ouaibe): *
* http://www2.cnam.fr/~lignelet *
* *
* Conservatoire National des Arts et Metiers *
* Departement d'Informatique *
* 292, rue Saint Martin (\
* 75141 PARIS Cedex 03 ( \
=========================================================) ) />
/ ) / //))/
\ \_/ /////
\ /
\_ /
| |
| |
-----
-----
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|