Okay the loop makes sense but what I don't understand is why my value is "red"? The value is the time I need to equip my SingleProc.
I have a list transformed from the Source like you can see at the pic. I gave the columns the following values:
Number is the rate
Name is the name of my container
Attribute is the color
So in the sublist I need the specification that the Attribute is the deciding equip attribute color and the value to equip of one minute. That means that the program actually does not contain the time value.
Maybe that's why all of this makes no sense. Because the list I give the program contains these 3 values and the SingleProc should equip when the Color changes and this takes 1 minute.
So for me this code is not really helpful I think.
Or do I understand wrong?
okay, to make it complete: if you want to have a second user defined attribute with the name e.g. equiptime, datatype time, value one minute (or color based), you need to extend the program:
for var i:=1 to main.yDim loop Main.erzeugeSubliste(4,i); //creating a sublist at the mainlist Main[4,i] [1,1] := "Color"; //name of the Attribute Main[4,i] [4,1] := "red";//value in column "string" Main[4,i] [1,2] := "equiptime"; //name of the Attribute Main[4,i] [6,2] := 60;//value in column "time" next
Insead of red and one minute insert your data from your table. If you mean with "equip" setup and if the setup time is constant, you dont need a user defined attribute, you only need to insert the setup time in the field setup time in your machine.
Okay I understand that's the reason why I don't need the time. Now it's clear thank you!
But anyway the code is still not working... Do I have to connect the method somehow to my List?
As I know normally it should work automatic.
I have a List called Main
my columns are called
MU(object) - Number(integer) - Name(string) - Attribute(table)
and than I just filled in my values and wrote the method but a sublist is not created and also not filled up...
What did I forget?
Also I tried to modify the code. Because I already have the color at the attribute column, so I just can copy the name:
for var i:=1 to main.yDim loop
Main[4,i] [1,1] := "Color";
Main[4,i] [4,1] := Main(4,i);
but its not working as well...
you need to start the method (e.g. right mouse click on the method --> run) Where do you have the colors for the lines of the main table? You need square brackets to access the table...
now its working but its doing something really strange...
At the beginning I have my original table (see Pic1) after running the method all my colors disappear (see Pic2)...
So I think that something in my code is still wrong I think because in the sublist its not writing down the name from the table its just writing main[4,i](see Pic3)...
Thats my code at the moment:
for var i:=1 to main.yDim loop
main[4,i] [1,1] := "Color";
main[4,i] [4,1] := "main[4,i]"
I inserted the 5th column.
But now its getting really strange...
If I use one of these codes its not working:
main[4,i] [4,1] := main[4,i];
main[4,i] [4,1] := main[5,i];
But if I use this one its working perfectly:
main[4,i] [4,1] := main[3,i]
Do you know why?