The first thing you can't do is define a function inside another function. That's what this message is telling you:
Quote:
|
'gas': local function definitions are illegal.
|
Move that definition BELOW (or ABOVE) main, it doesn't get to be inside. Inside is where you CALL the effer.
Fix that, and come back if you're still fuzzled.