for some reason i called one function to save something to the list, and calling another function to load it, the load function doesn't pick up the updated list. Am i missing something??
Please help, thanks!

Mobius
These forums are CLOSED. Please visit the new forums HERE
question with updating a list of things |
|
|
Mobius Hashimoto
Registered User
Join date: 18 Aug 2006
Posts: 146
|
09-17-2006 12:34
Hi guys,
for some reason i called one function to save something to the list, and calling another function to load it, the load function doesn't pick up the updated list. Am i missing something?? Please help, thanks! ![]() Mobius |
|
Kage Seraph
I Dig Giant Mecha
Join date: 3 Nov 2004
Posts: 513
|
09-17-2006 13:28
Hello hello! Please post the script (or excerpt thereof) as doing so removes a lot of ambiguity from the description of the problem. Kneejerk diagnosis: have you doublechecked the method in which you're appending new list items to the list?
for a previously declared list, foo, foo += ["meaty fetus"]; _____________________
|
|
Mobius Hashimoto
Registered User
Join date: 18 Aug 2006
Posts: 146
|
09-17-2006 13:44
hi,
list todo_list = []; /its empty at first this is what i have save(string data) { todo_list += data; } load () { for loop and loop through the list but its empty cos its still referring to the initial one } hope this is clear enough ![]() Thanks |
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
09-17-2006 13:56
I think you add a list to a list. Surprised that compliles. Ah well, I might be wrong.
I usually generate the string to be added with CODE list toBeAdded = (list) ("[" + someString + "]"); |
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
09-17-2006 14:02
Looks like the wiki might be back!
http://rpgstats.com/wiki/index.php?title=List |
|
Mobius Hashimoto
Registered User
Join date: 18 Aug 2006
Posts: 146
|
09-17-2006 14:05
oh my god, i'm just being stupid,
i called the save function with the empty list everytime, i shouldn't have passed in the list as one of the parameters, just the new data. haha, thanks for the help guys. |