On Monday 19 August 2002 16:12, you wrote:
> I think you are correct that this would be a good addition. How are
> you at writing C code? If you want to take this on, the developers on
> the dev list would be willing to coach you as you write it.

Here is what I thought of, as a macro only, but it works reasonably well for 
my purposes. It's not been thoroughly tested, though, so use at your own 
risk. Thanks to Greg for pointing me to the solution, it is only a variation 
of his macro.
==cut here=========================================
//
// time: Mon Aug 26 16:03:20 2002
//
// version: 3.1.2 (format), 4.1.3 (DX)
//
//
// Begin MDF
// MODULE SlabSlice
// CATEGORY Macros
// INPUT input; field; (no default); 
// INPUT dimension; integer or string; (no default); 
// INPUT position; integer or integer list; (no default); 
// INPUT thickness; integer; (no default); 
// OUTPUT output_1; value or value list or field;  
// End MDF
// page assignment: main        order=2, windowed=0, showing=1
// workspace: width = 549, height = 873
// layout: snap = 0, width = 50, height = 20, align = NN
//
macro SlabSlice(
 input
,dimension
,position
,thickness
) -> (
 output_1
) {
    // 
    // node Input[5]: x = 343, y = 56, inputs = 0, label = Input
    // page group: main
    // parameter: position = 4, name = 'thickness', value = '(no default)', 
descriptive = 1, description = ' ', required = 0, visible = 1
    //
SlabSlice_Input_5_out_1 = thickness;
    // 
    // node Compute[11]: x = 90, y = 322, inputs = 2, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0-1"
    // page group: main
    // expression: value = a-1
    // name[2]: value = a
    //
SlabSlice_Compute_11_out_1 = 
    Compute(
    "$0-1",
    SlabSlice_Input_5_out_1
    ) [instance: 11, cache: 1];
    // 
    // node Input[2]: x = 61, y = 56, inputs = 0, label = Input
    // page group: main
    // parameter: position = 1, name = 'input', value = '(no default)', 
descriptive = 1, description = ' ', required = 0, visible = 1
    //
SlabSlice_Input_2_out_1 = input;
    // 
    // node Input[3]: x = 151, y = 56, inputs = 0, label = Input
    // page group: main
    // parameter: position = 2, name = 'dimension', value = '(no default)', 
descriptive = 1, description = ' ', required = 0, visible = 1
    //
SlabSlice_Input_3_out_1 = dimension;
    // 
    // node Input[4]: x = 247, y = 55, inputs = 0, label = Input
    // page group: main
    // parameter: position = 3, name = 'position', value = '(no default)', 
descriptive = 1, description = ' ', required = 0, visible = 1
    //
SlabSlice_Input_4_out_1 = position;
    // 
    // node Slab[1]: x = 136, y = 163, inputs = 4, label = Slab
    // page group: main
    //
SlabSlice_Slab_1_out_1 = 
    Slab(
    SlabSlice_Input_2_out_1,
    SlabSlice_Input_3_out_1,
    SlabSlice_Input_4_out_1,
    SlabSlice_Input_5_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Slice[1]: x = 172, y = 245, inputs = 3, label = Slice
    // input[3]: defaulting = 1, visible = 1, type = 16777217, value = NULL
    // page group: main
    //
SlabSlice_Slice_1_out_1 = 
    Slice(
    SlabSlice_Slab_1_out_1,
    SlabSlice_Input_3_out_1,
    NULL
    ) [instance: 1, cache: 1];
    // 
    // node Inquire[6]: x = 279, y = 322, inputs = 3, label = Inquire
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "object tag"
    // page group: main
    //
SlabSlice_Inquire_6_out_1 = 
    Inquire(
    SlabSlice_Slice_1_out_1,
    "object tag",
    NULL
    ) [instance: 6, cache: 1];
    // 
    // node GetLocal[3]: x = 390, y = 322, inputs = 3, label = GetLocal
    // input[1]: defaulting = 0, visible = 1, type = 67108863, value = -1
    // page group: main
    //
SlabSlice_GetLocal_3_out_1,
SlabSlice_GetLocal_3_out_2 = 
    GetLocal(
    -1,
    NULL,
    NULL
    ) [instance: 3, cache: 1];
    // 
    // node Compute[12]: x = 298, y = 397, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 == $1 ? 
0 : 1"
    // page group: main
    // expression: value = a == b ? 0 : 1
    // name[2]: value = a
    // name[3]: value = b
    //
SlabSlice_Compute_12_out_1 = 
    Compute(
    "$0 == $1 ? 0 : 1",
    SlabSlice_Inquire_6_out_1,
    SlabSlice_GetLocal_3_out_1
    ) [instance: 12, cache: 1];
    // 
    // node Enumerate[3]: x = 64, y = 394, inputs = 5, label = Enumerate
    // input[1]: defaulting = 0, visible = 1, type = 29, value = 1
    // input[4]: defaulting = 0, visible = 1, type = 29, value = 1
    // page group: main
    //
SlabSlice_Enumerate_3_out_1 = 
    Enumerate(
    1,
    NULL,
    SlabSlice_Compute_11_out_1,
    1,
    NULL
    ) [instance: 3, cache: 1];
    // 
    // node Select[5]: x = 48, y = 473, inputs = 3, label = Select
    // page group: main
    //
SlabSlice_Select_5_out_1 = 
    Select(
    SlabSlice_Slice_1_out_1,
    SlabSlice_Enumerate_3_out_1,
    NULL
    ) [instance: 5, cache: 1];
    // 
    // node ForEachMember[3]: x = 12, y = 546, inputs = 1, label = 
ForEachMember
    // page group: main
    //
SlabSlice_ForEachMember_3_out_1,
SlabSlice_ForEachMember_3_out_2,
SlabSlice_ForEachMember_3_out_3 = 
    ForEachMember(
    SlabSlice_Select_5_out_1
    ) [instance: 3, cache: 1];
    // 
    // node Select[6]: x = 196, y = 322, inputs = 3, label = Select
    // input[2]: defaulting = 0, visible = 1, type = 1, value = 0
    // page group: main
    //
SlabSlice_Select_6_out_1 = 
    Select(
    SlabSlice_Slice_1_out_1,
    0,
    NULL
    ) [instance: 6, cache: 1];
    // 
    // node GetLocal[4]: x = 282, y = 476, inputs = 3, label = GetLocal
    // page group: main
    //
SlabSlice_GetLocal_4_out_1,
SlabSlice_GetLocal_4_out_2 = 
    GetLocal(
    SlabSlice_Select_6_out_1,
    SlabSlice_Compute_12_out_1,
    NULL
    ) [instance: 4, cache: 1];
    // 
    // node Compute[13]: x = 247, y = 620, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+$1"
    // page group: main
    // expression: value = a+b
    // name[2]: value = a
    // name[3]: value = b
    //
SlabSlice_Compute_13_out_1 = 
    Compute(
    "$0+$1",
    SlabSlice_ForEachMember_3_out_1,
    SlabSlice_GetLocal_4_out_1
    ) [instance: 13, cache: 1];
    // 
    // node Route[3]: x = 245, y = 716, inputs = 2, outputs = 2, label = Route
    // page group: main
    //
SlabSlice_Route_3_out_1,
SlabSlice_Route_3_out_2 = 
    Route(
    SlabSlice_ForEachMember_3_out_3,
    SlabSlice_Compute_13_out_1
    ) [instance: 3, cache: 1];
    // 
    // node Compute[14]: x = 480, y = 743, inputs = 3, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = 
"$0/float($1)"
    // page group: main
    // expression: value = a/float(b)
    // name[2]: value = a
    // name[3]: value = b
    //
SlabSlice_Compute_14_out_1 = 
    Compute(
    "$0/float($1)",
    SlabSlice_Route_3_out_1,
    SlabSlice_Input_5_out_1
    ) [instance: 14, cache: 1];
    // 
    // node Output[1]: x = 487, y = 811, inputs = 1, label = Output
    // page group: main
    // parameter: position = 1, name = 'output_1', value = ' ', descriptive = 
0, description = ' ', required = 0, visible = 1
    //
output_1 = SlabSlice_Compute_14_out_1;
    // 
    // node SetLocal[3]: x = 391, y = 399, inputs = 3, label = SetLocal
    // page group: main
    //
    SetLocal(
    SlabSlice_Inquire_6_out_1,
    SlabSlice_GetLocal_3_out_2,
    NULL
    ) [instance: 3, cache: 1];
    // 
    // node SetLocal[4]: x = 334, y = 689, inputs = 3, label = SetLocal
    // page group: main
    //
    SetLocal(
    SlabSlice_Compute_13_out_1,
    SlabSlice_GetLocal_4_out_2,
    NULL
    ) [instance: 4, cache: 1];
// network: end of macro body
}
SlabSlice_Input_5_out_1 = NULL;
SlabSlice_Compute_11_out_1 = NULL;
SlabSlice_Input_2_out_1 = NULL;
SlabSlice_Input_3_out_1 = NULL;
SlabSlice_Input_4_out_1 = NULL;
SlabSlice_Slab_1_out_1 = NULL;
SlabSlice_Slice_1_out_1 = NULL;
SlabSlice_Inquire_6_out_1 = NULL;
SlabSlice_GetLocal_3_out_1 = NULL;
SlabSlice_GetLocal_3_out_2 = NULL;
SlabSlice_Compute_12_out_1 = NULL;
SlabSlice_Enumerate_3_out_1 = NULL;
SlabSlice_Select_5_out_1 = NULL;
SlabSlice_ForEachMember_3_out_1 = NULL;
SlabSlice_ForEachMember_3_out_3 = NULL;
SlabSlice_Select_6_out_1 = NULL;
SlabSlice_GetLocal_4_out_1 = NULL;
SlabSlice_GetLocal_4_out_2 = NULL;
SlabSlice_Compute_13_out_1 = NULL;
SlabSlice_Route_3_out_1 = NULL;
SlabSlice_Compute_14_out_1 = NULL;
==cut here=========================================
-- 
Dr. Wolfgang Braun
Paul-Drude Institute
for Solid State Electronics
Hausvogteiplatz 5-7
D-10117 Berlin

office: +49-(0)30-20377-366
bessy: +49-(0)30-6392-4879
mobile: +49-(0)170-2635-118
fax  : +49-(0)30-20377-201

Reply via email to