<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Defining record structure members as static parameters in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Defining-record-structure-members-as-static-parameters/m-p/980061#M25876</link>
    <description>Defining record structure members as static parameters &lt;BR /&gt; &lt;BR /&gt; Can anyone tell me if members of a record structure can be defined with static values. Can the parameter statement &lt;BR /&gt; be used in this regard. For example, let's say you wish to create two variables of the same  structure, one containing the base values (which would be static) and one which has varying values. How do you define static values for each of the structure's members?  &lt;BR /&gt; &lt;BR /&gt;                        Structure /XYZ/  &lt;BR /&gt;                        Logical BUS_BUSY  &lt;BR /&gt;                                  Real x_float  &lt;BR /&gt;                                  Integer y_int  &lt;BR /&gt;                        End Structure  &lt;BR /&gt;                        Record /XYZ/ XYX_var, XYZ_base  &lt;BR /&gt; &lt;BR /&gt; I have used the PARAMETER statement in several dozen different ways without luck.  &lt;BR /&gt; Has anyone solved this previously??  &lt;BR /&gt; &lt;BR /&gt;Thanks in advance.  &lt;BR /&gt;mjfinney</description>
    <pubDate>Fri, 11 Jan 2002 07:56:42 GMT</pubDate>
    <dc:creator>mjfinney</dc:creator>
    <dc:date>2002-01-11T07:56:42Z</dc:date>
    <item>
      <title>Defining record structure members as static parameters</title>
      <link>https://community.intel.com/t5/Software-Archive/Defining-record-structure-members-as-static-parameters/m-p/980061#M25876</link>
      <description>Defining record structure members as static parameters &lt;BR /&gt; &lt;BR /&gt; Can anyone tell me if members of a record structure can be defined with static values. Can the parameter statement &lt;BR /&gt; be used in this regard. For example, let's say you wish to create two variables of the same  structure, one containing the base values (which would be static) and one which has varying values. How do you define static values for each of the structure's members?  &lt;BR /&gt; &lt;BR /&gt;                        Structure /XYZ/  &lt;BR /&gt;                        Logical BUS_BUSY  &lt;BR /&gt;                                  Real x_float  &lt;BR /&gt;                                  Integer y_int  &lt;BR /&gt;                        End Structure  &lt;BR /&gt;                        Record /XYZ/ XYX_var, XYZ_base  &lt;BR /&gt; &lt;BR /&gt; I have used the PARAMETER statement in several dozen different ways without luck.  &lt;BR /&gt; Has anyone solved this previously??  &lt;BR /&gt; &lt;BR /&gt;Thanks in advance.  &lt;BR /&gt;mjfinney</description>
      <pubDate>Fri, 11 Jan 2002 07:56:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Defining-record-structure-members-as-static-parameters/m-p/980061#M25876</guid>
      <dc:creator>mjfinney</dc:creator>
      <dc:date>2002-01-11T07:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Defining record structure members as static parameters</title>
      <link>https://community.intel.com/t5/Software-Archive/Defining-record-structure-members-as-static-parameters/m-p/980062#M25877</link>
      <description>Hmm.  First of all, you can specify initial values for fields in a structure.  For example:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;FONT size="+0"&gt;
structure /XYZ/
  logical BUS_BUSY /.TRUE./
  real x_float /3.0/
  integer y_int /4/
  end structure
&lt;/FONT&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Then, any RECORD of this type will get statically (one time) initialized to these values.  It is interesting to note that this is one area where STRUCTURE/RECORD is not the same as Fortran 90 derived type - if you had done the same thing with derived types, and the variable was a routine local, it would get reinitialized on every entry to the routine, unless you made the variable SAVE.&lt;BR /&gt;&lt;BR /&gt;Now you CAN create a PARAMETER constant of a structure type, but you have to speak Fortran 90.  For example:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;FONT size="+0"&gt;
type(XYZ), PARAMETER :: my_const = XYZ(.TRUE.,3.0,4)
type(XYZ) XYX_VAR
XYX_VAR = my_const
&lt;/FONT&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;I'm not sure exactly what you want - you could define a type (structure) with some fields initialized and then selectively assign to particular fields later (there is no way to create a structure constructor (that's what that PARAMETER value above has) that skips some fields.  If you just want a way to assign at run-time a preselected set of fields, then the PARAMETER idea above will work.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 11 Jan 2002 09:39:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Defining-record-structure-members-as-static-parameters/m-p/980062#M25877</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-01-11T09:39:52Z</dc:date>
    </item>
  </channel>
</rss>

