gmplGetSetStatement

GetSet Statement Summary

Get, Set, and Let are terminal, substatements of the Property statement. They can also occur within Migrate refactoring statements that are changing the GetSetLet status of a property. A property has a value but that value is maintained via three possible methods: Get which retrieves the value of the property; Set which assigns an object instance to the property; and Let which assigns a value to the property. These substatements are used when these operations in the target language must be handled differently.

The attributes of the Get, Set, and Let substatements all pertain to the authoring of the property in the context of the operation being performed. They are as follows:

Attribute Description
MigPattern This string attribute associates a surface pattern string with code references to the property of the indicated type. See the Patterns page for details on the content of pattern strings. It is equivalent to the All pattern.
CshPattern This string attribute associates a surface pattern string with code references to the property of the indicated type. See the Patterns page for details on the content of pattern strings. It is equivalent to the Csh pattern.
VbnPattern This string attribute associated a surface pattern string with code references to the property of the indicated type. See the Patterns page for details on the content of pattern strings. It is equivalent to the Vbn pattern.
Npram This integer attribute specifies the number of parameters associated with the surface pattern strings.
Role This attribute contains an optional keyword describing the overall role of the operation being authored via the surface pattern strings: Unknown, Property, Method, Define, Utility, Command, Constant, Function, Event, Control, Collection, Resource, Index, or Migclass. The default is None.
Patstatus An optional keyword describing the overall status of the operation authored via the surface pattern strings: Ok, Delete, Deprecated, NotImplemented, MustCorrect, NotIdent, Postfix, or NeedsPren. The default is Ok.

The script errors associated with the Get, Set, or Let statements are as follows:

Error Description
1038 Encountered following when expecting 'get', 'set', or 'let': %1d
1039 Unable to store argument vector: %1d

As an example of these statements this is a property declaration within the Mscomctllib.IListView class, that migrates IListView.SelectedItem.Get to FocusedItem


  <property id="SelectedItem" type="Tab" status="GetSetLet">
     <Get npram="1" migPattern="%1d.FocusedItem"/>
     <Set npram="2" migPattern="%1d.SelectedItem = %2d\c"/>
     <Let npram="2" migPattern="%2d.let_SelectedItem(%1d)\c"/>
  </property>
Note that letters of the form obj.let_Property(value) are another Interop holdover that do not make sense in a migrated native code. They are ignored here for Global builds.

As an example of these statements within a Migrate statement, consider this migration of MSComCtl2.IMonthView.Value


  <Migrate id="IMonthView.Value" status="GetSet" >
      <Get nPram="1" migPattern="%1d.SelectionStart" />
      <Let nPram="2" migPattern="%2d.SetDate(%1d)\c" />
 </Migrate>


Table of Contents