Anand Veeraswamy
2005-09-03 17:15:52 UTC
Hi,
I have 2 issues while using lists in breve.
1) If I have a nested list like tempList={ {1,2}, {3,4} }
I am able to access individual elements of this list using tempList{0}{0} or tempList{0}{1} which will give 1 and 2 respectively
But I am unable to create a nested list using the following commands
tempList{0}{0} = 1
tempList{0}{1} = 2
when I try using the above 2 commands I get an error saying that the "list index 0 is out of bounds"
Why does this happen??
Is there any other method to create nested lists?? I need to assign the individual elements of the nested list.
2) In order to over come this issue I started using the push list function
I create 2 lists like .....
tempList1 = { LifePatch (0A458E38) , LifePatch (0A459080) } # LifePatch is the name of the class which inherits the Patch class
tempList2 = { LifePatch (0A458E38) , LifePatch (0A458760) } # The elements of the list are Patches
Then I use the push function in this way
push tempList1 onto pathList.
push tempList2 onto pathList.
Now when I check the pathList I get something like this
pathList = { { LifePatch (0A458E38) , LifePatch (0A458760) }, [circular list reference 0A49FED0] }
What is Circular list reference??
Actually I am using a while loop to implement the above coding
while(length3>=0): {
i=0.
tempList2{i} = tempList1{0}.
i++.
tempList2{i} = neighborList{length3}.
push tempList2 onto pathList. # At each iteration the list created is pushed
length3--.
}
Please help me resolve the above issues.
Thanks and regards,
Anand.
I have 2 issues while using lists in breve.
1) If I have a nested list like tempList={ {1,2}, {3,4} }
I am able to access individual elements of this list using tempList{0}{0} or tempList{0}{1} which will give 1 and 2 respectively
But I am unable to create a nested list using the following commands
tempList{0}{0} = 1
tempList{0}{1} = 2
when I try using the above 2 commands I get an error saying that the "list index 0 is out of bounds"
Why does this happen??
Is there any other method to create nested lists?? I need to assign the individual elements of the nested list.
2) In order to over come this issue I started using the push list function
I create 2 lists like .....
tempList1 = { LifePatch (0A458E38) , LifePatch (0A459080) } # LifePatch is the name of the class which inherits the Patch class
tempList2 = { LifePatch (0A458E38) , LifePatch (0A458760) } # The elements of the list are Patches
Then I use the push function in this way
push tempList1 onto pathList.
push tempList2 onto pathList.
Now when I check the pathList I get something like this
pathList = { { LifePatch (0A458E38) , LifePatch (0A458760) }, [circular list reference 0A49FED0] }
What is Circular list reference??
Actually I am using a while loop to implement the above coding
while(length3>=0): {
i=0.
tempList2{i} = tempList1{0}.
i++.
tempList2{i} = neighborList{length3}.
push tempList2 onto pathList. # At each iteration the list created is pushed
length3--.
}
Please help me resolve the above issues.
Thanks and regards,
Anand.