!   TITLE:  par_array.mac (MANAGEMENT)
!
!               Convert to Perl for speed. Maintain exact same
!               functionality.
!               If running under ANSYS/ED, call "par_array-.mac"
!               otherwise run with par_array.perl.  This is needed for
!               AnsysED 5.7 which will not run /SYS or /SYP commands.
!               Ansys 6.1 removed the *get option "ProdType" which broke
!               "no_sys_=1" should be added to startXX.ans when an
!               Ansys product does not support the /SYS and /SYP commands.
!               Switch to the use of "_have_sys" instead of "no_sys_"
!               and use APDL by default unless "_have_sys" is set to 
!               one to specify the use of the Perl version.
!
!   OBJECTIVE:
!
!   For the current part, this sub-macro stores the parameters and their values
!   into arrays.
!
!
!   COMMAND SYNTAX:
!
!      PAR_ARRAY, pararnam
!
!
!   DESCRIPTION:
!
!   This sub-macro creates a character array containing all active parameters
!   in the database, and a scalar array containing their corresponding values.
!   The only input necessary is a user specified array character name. This
!   name is the name of the array that will store all parameters of a given
!   parameter file.  The input name must be 5 characters or less, and will
!   also be used for the parameter value array.
!
!               pararnam = parameter file array name.  This name must be 5
!                          characters or less.
!
!   Both arrays will start with the character name as specidied in 'pararnam'.
!   However, the parameter value array name will end with a 'v' (-----v).
!   Therefore, the value array is just the parameter name array with a 'v'
!   attached to the end.
!
!   Only numeric scalar parameters are stored in the array.  These
!   parameters are deleted once stored.
!
!   Character scalars, arrays and parameters prefixed with an
!   underscore, "_" are not stored and are not deleted.
!
!   This macro also updates the system arrays:
!
!       PARFMXI
!       PAR_FILE
!       PFMXIBUF
!       PARFBUFF
!
!

*get,prkey_,active,0,prkey
/nopr

! pararnam=arg1

!_have_sys=1          ! Uncomment to force the use of the Perl version


*if,_have_sys,eq,1,then

    parsav,all,par_array,in

    /syp,runperl.bat par_array.perl,arg1

    parres,new,par_array,out

*else
!
*msg,warn
Using slow APDL version of par_array. %/&
If Perl is configured, set "_have_sys=1" to use the Perl version.
!
par_array-,arg1
!
*endif

*if,prkey_,eq,1,then
    /go
*endif