Incrementing Function

Maybe I’m too tired to be doing this. I am trying to make a simple function that will increment a variable by one and return the new number. I want to use it to assign depths. I just want to start at 0, increment with each call of the function, and have the function return the value of the variable. I have tried about 20 variations of this:

var currDepth:Number = 0;
function setDepth() {
currDepth++;
return currDepth;
}

or

var currDepth:Number = 0;
function setDepth() {
var thisDepth:Number = currDepth;
currDepth++;
return thisDepth;
}