Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, 言語解説書

BY NAME を使用した構造体の割り当て例

次の例は、BY NAME オプションを使用した構造体割り当てを示します。

  declare      declare       declare
  1 One,       1 Two,        1 Three,
   2 Part1,     2 Part1,      2 Part1,
    3 Red,       3 Blue,       3 Red,
    3 Orange,    3 Green,      3 Blue,
   2 Part2,      3 Red,        3 Brown,
    3 Yellow,   2 Part2,      2 Part2,
    3 Blue,      3 Brown,      3 Yellow,
    3 Green;     3 Yellow;     3 Green;
 1 
 2 
  One = Two, by name;
  One.Part1 = Three.Part1, by name;
 1 
最初の代入ステートメントは、次のステートメントと同じです。
  One.Part1.Red    = Two.Part1.Red;
  One.Part2.Yellow = Two.Part2.Yellow;
 2 
2 番目の代入ステートメントは、次のステートメントと同じです。
  One.Part1.Red = Three.Part1.Red;

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)