ID:266635
 
How do I get this to work?

    var/savefile/S = new("players.t")

Write(savefile/S)
..()

F["WM"] << worldmoney

Read(savefile/S)
..()

var/worldmoney = 0
F["SavedMoney"] >> worldmoney
worldmoney = SavedMoney


It says "Save:dm:52:error: proc definiton not allowed inside another proc
You have to have the samething in both []

An example:
mob
verb
save()
var/savefile/F = new("[usr.ckey].sav")
F["somevar"] << usr.varname //loads the var called varname into F and tags it "somevar"

load()
var/savefile/F = new("[usr.ckey].sav")
F["somevar"] >> usr.varname //finds the information tagged "somevar" and loads that information to usr.varname
In response to Nadrew
Isn't working...
Ok now it says "empty type name (indentation error?)

var/savefile/S = new("[worldmoney].sav")

Write(savefile/S)
..()

S["WM"] << worldmoney

Read(savefile/S)
..()

S["SavedMoney"] >> worldmoney
worldmoney = worldmoney


What's wrong now?
In response to Thief Jack
You didn't pay attention to my post at all, read it again.
In response to Nadrew
I've read it thrice and I'll I see is that little [] tags between the save file things and that they're in the save and load code but that didn't help it, it worsened it.