Maybe the help for “Deep Assignment” would help. Not the greatest, but maybe you’d come up with something that works.
Or maybe put a STRING,OVER your 4 LONGs (by &reference or declaration) then assign like
MyString = ‘<0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4>’.
My Group is a 60-element array of 4-element arrays of single digit integers. It would be nice to assign each of the 60 group elements a different 4-element array with a single line. That is 60 lines vs. 240 lines if each of the four elements must be done individually.
Modifying Jeff’s suggestion, I find that ArGrp[1].Arg[1:4] = ‘1234’ works; but it still leaves a problem with negative integers: ArGrp[2].Arg[1:4] = ‘123-4’ is a FIVE-member string.
Two thoughts occur: 1) It’s hard to believe this cannot be done easily. It seems to be easy in C++ : int array [ ] = {1,3,34,5,6}
2) I find the context help woefully poor in fine details on many issues.
I would create a little Procedure so it can be done in 1 line:
MAP
ArGrp_Assign PROCEDURE(USHORT GrpRow, LONG Arg1, LONG Arg2, LONG Arg3, LONG Arg4)
END
CODE
ArGrp_Assign(1, 1,2,3,4)
ArGrp_Assign(2, 5,6,7,8)
ArGrp_Assign(3, 9,10,11,12)
...
ArGrp_Assign(60, 65,66,67,68)
ArGrp_Assign PROCEDURE(USHORT GrpRow, LONG Arg1, LONG Arg2, LONG Arg3, LONG Arg4)
CODE
ArGrp[GrpRow].Arg[1]=Arg1
ArGrp[GrpRow].Arg[2]=Arg2
ArGrp[GrpRow].Arg[3]=Arg3
ArGrp[GrpRow].Arg[4]=Arg4
RETURN
Alternative is to make it a CLASS. You will probably have other procedures for this big array:
ArGrpCls CLASS
Assign1 PROCEDURE(USHORT GrpRow, LONG Arg1, LONG Arg2, LONG Arg3, LONG Arg4)
END
CODE
ArGrpCls.Assign1(1, 1,2,3,4)
ArGrpCls.Assign1(2, 5,6,7,8)
ArGrpCls.Assign1(3, 9,10,11,12)
...
ArGrpCls.Assign1(60, 65,66,67,68)
ArGrpCls.Assign1 PROCEDURE(USHORT GrpRow, LONG Arg1, LONG Arg2, LONG Arg3, LONG Arg4)
CODE
ArGrp[GrpRow].Arg[1]=Arg1
ArGrp[GrpRow].Arg[2]=Arg2
ArGrp[GrpRow].Arg[3]=Arg3
ArGrp[GrpRow].Arg[4]=Arg4
RETURN
Thanks for the help and suggestions. It looks s if there are several ways to approach this problem. I am, of course, looking for the one with the least typing and least prone to typing error. Will see what works best. I cannot help but think that there should be an easy way to assign values to several elements of an array in one statement.