Function call not return value into var

hi friends,

I writing a script, one of the function there is:

###################################
########### Return 1 if has subfolders and 0 otherwise ##################
# Get one Argument - Folder name

Has_Subfolders()
{
count=0
cd $1
for zont in `ls -l | grep drw | awk '{print $9;}'`
do
if [[ -d $zont ]]
then
count=1
fi
done
cd ..
return $count
}

When I call it from another function, the debug telling me that the function return value=1 but I can not see it in my varieable while I write like this:

ta=`Has_Subfolders $1`
echo $ta

Can please someone explain me why?

functions return a status code

use echo $? to see the value.

In general when you need a function to return something do it like this

#!/bin/ksh
foo()
{
       echo $(( $1 + 13 ))
}

value=$( foo 8)
echo $value

Ye, thanks man, but it just the same, as I wrote, you could see :

ta=`Has_Subfolders $1`

is equal to :
ta=$(Has_Subfolders $1)

So friends, may someone to real help me with this problem?

Don't return; instead, echo

Thanks man