MoveToId (Stringlist subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%"><b>Move data from Stringlist to $list</b></span>
{{Template:Stringlist:MoveToId subtitle}}


This method moves data (Stringlist items) from a Stringlist to a $list. MoveToId is a subroutine that accepts one argument: the $list identifier of the $list to which data is to be moved. For more information about $list identifiers, see the ''Sirius Functions Reference Manual''.
This method moves data (Stringlist items) from a Stringlist to a $list. MoveToId is a subroutine that accepts one argument: the $list identifier of the $list to which data is to be moved. For more information about $list identifiers, see the ''Sirius Functions Reference Manual''.
Line 5: Line 5:
MoveToId is a member of the [[Stringlist class]].
MoveToId is a member of the [[Stringlist class]].


==MoveToId Syntax==
==Syntax==
<pre>
{{Template:Stringlist:MoveToId syntax}}
%sl:MoveToId(listid)
===Syntax terms===
</pre>
 
===Syntax Terms===
<dl>
<dl>
<dt>%sl
<dt>%sl
Line 16: Line 13:
</dl>
</dl>


==Usage Notes==
==Usage notes==
<ul><li>All errors in MoveToId result in request cancellation.<li>After the MoveToId method is invoked, the method Stringlist is empty, though the object variable is still valid (non-null).<li>MoveToId discards the original contents of the target $list.<li>The MoveToId method copies to the target $list any image association that is set via BindImage.<li>MoveToId simply moves the pointers to the Stringlist data to the target $list. It does '''not''' actually perform any data movement; therefore, it is extremely efficient.<li>MoveToId is intended to facilitate the migration to the use of Stringlists of existing applications that use $lists. For example, suppose complex subroutine Summarize takes a $list identifier as its input parameter. Now, suppose some code that has a Stringlist in %list wants to pass the Stringlist to Summarize.  
<ul><li>All errors in MoveToId result in request cancellation.<li>After the MoveToId method is invoked, the method Stringlist is empty, though the object variable is still valid (non-null).<li>MoveToId discards the original contents of the target $list.<li>The MoveToId method copies to the target $list any image association that is set via BindImage.<li>MoveToId simply moves the pointers to the Stringlist data to the target $list. It does '''not''' actually perform any data movement; therefore, it is extremely efficient.<li>MoveToId is intended to facilitate the migration to the use of Stringlists of existing applications that use $lists. For example, suppose complex subroutine Summarize takes a $list identifier as its input parameter. Now, suppose some code that has a Stringlist in %list wants to pass the Stringlist to Summarize.  
The following code illustrates how this can be accomplished:
The following code illustrates how this can be accomplished:

Revision as of 19:51, 31 December 2010

Move data from Stringlist to $list (Stringlist class)


This method moves data (Stringlist items) from a Stringlist to a $list. MoveToId is a subroutine that accepts one argument: the $list identifier of the $list to which data is to be moved. For more information about $list identifiers, see the Sirius Functions Reference Manual.

MoveToId is a member of the Stringlist class.

Syntax

sl:MoveToId( listId)

Syntax terms

%sl
A Stringlist object.
listid
The $list identifier of the $list to which data is to be moved.

Usage notes

  • All errors in MoveToId result in request cancellation.
  • After the MoveToId method is invoked, the method Stringlist is empty, though the object variable is still valid (non-null).
  • MoveToId discards the original contents of the target $list.
  • The MoveToId method copies to the target $list any image association that is set via BindImage.
  • MoveToId simply moves the pointers to the Stringlist data to the target $list. It does not actually perform any data movement; therefore, it is extremely efficient.
  • MoveToId is intended to facilitate the migration to the use of Stringlists of existing applications that use $lists. For example, suppose complex subroutine Summarize takes a $list identifier as its input parameter. Now, suppose some code that has a Stringlist in %list wants to pass the Stringlist to Summarize. The following code illustrates how this can be accomplished:
    %listid = $listnew
    %list:moveToId(%listId)
    call summarize(%listId)
    %list:moveFromId(%listId)
    return
    

    Stringlists should always be used in preference to $lists, so MoveToId is provided only for the migration of existing $list applications to the use of Stringlists.