You don't need // before write. It's in a script; everything that starts a line in a script must be a command of some sort (excepting ; for a comment line or } for a block close).