// // time: Wed Apr 24 07:56:19 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE SumList // CATEGORY Macros // DESCRIPTION Accumulates the values in a list // INPUT list; object; (none); list of values to accumulate // INPUT initial_value; object; 0; initial value for accumulation // OUTPUT output_1; value or value list or field; // End MDF // // comment: This macro accumulates the values in a list. // comment: // comment: The user specifies the list and an initial value for the accumulation (which defaults to 0). The accumulation is automatically reset each time the macro is rerun. // comment: (C) COPYRIGHT International Business Machines Corp. 1996. // comment: All Rights Reserved. // comment: Licensed Materials - Property of IBM // comment: // comment: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. // comment: // comment: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IBM DOES NOT WARRANT AGAINST THE INFRINGMENT OF PATENTS, COPYRIGHT OR ANY OTHER INTELLECTUAL PROPERTY RIGHTS OF OTHERS. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, IS WITH YOU. // comment: // workspace: width = 370, height = 426 // layout: snap = 0, width = 50, height = 50, align = NN // macro SumList( list ,initial_value = 0 ) -> ( output_1 ) { // // node Input[7]: x = 32, y = 20, inputs = 0, label = Input // parameter: position = 1, name = 'list', value = ' ', descriptive = 0, description = 'list of values to accumulate', required = 1, visible = 1 // SumList_Input_7_out_1 = list; // // node ForEachMember[1]: x = 40, y = 91, inputs = 1, label = ForEachMember // SumList_ForEachMember_1_out_1, SumList_ForEachMember_1_out_2, SumList_ForEachMember_1_out_3 = ForEachMember( SumList_Input_7_out_1 ) [instance: 1, cache: 1]; // // node Input[8]: x = 217, y = 58, inputs = 0, label = Input // parameter: position = 2, name = 'initial_value', value = '0', descriptive = 0, description = 'initial value for accumulation', required = 0, visible = 1 // SumList_Input_8_out_1 = initial_value; // // node First[1]: x = 331, y = 36, inputs = 0, label = First // SumList_First_1_out_1 = First( ) [instance: 1, cache: 1]; // // node Get[1]: x = 228, y = 131, inputs = 3, label = Get // SumList_Get_1_out_1, SumList_Get_1_out_2 = Get( SumList_Input_8_out_1, SumList_First_1_out_1, NULL ) [instance: 1, cache: 1]; // // node Compute[9]: x = 94, y = 190, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+$1" // expression: value = a+b // name[2]: value = a // name[3]: value = b // SumList_Compute_9_out_1 = Compute( "$0+$1", SumList_ForEachMember_1_out_1, SumList_Get_1_out_1 ) [instance: 9, cache: 1]; // // node Output[3]: x = 152, y = 363, inputs = 1, label = Output // parameter: position = 1, name = 'output_1', value = ' ', descriptive = 0, description = ' ', required = 0, visible = 1 // output_1 = SumList_Compute_9_out_1; // // node Set[1]: x = 252, y = 269, inputs = 3, label = Set // Set( SumList_Compute_9_out_1, SumList_Get_1_out_2, NULL ) [instance: 1, cache: 1]; // network: end of macro body } SumList_Input_7_out_1 = NULL; SumList_ForEachMember_1_out_1 = NULL; SumList_Input_8_out_1 = NULL; SumList_First_1_out_1 = NULL; SumList_Get_1_out_1 = NULL; SumList_Get_1_out_2 = NULL; SumList_Compute_9_out_1 = NULL;