How to assign awk values to shell variable?

Hi Gurus,
I have a script which assign awk output to shell variable. current it uses two awk command to assign value to two variables. I want to use one command to assign two values to two variables. I tried the code, but it does't work. kindly provide your suggestion.
current code

maxlength=`awk 'BEGIN{a=1}{if (length($0)>a) a=length($0)} END{print a}' file`
minlength=`awk 'BEGIN{a=10000}{if (length($0)<a) a=length($0)} END{print a}' file`

want to change to

awk 'BEGIN{
        a=1
        b=10000
        }
        {
                if (length($0)>a) a=length($0) 
                if (length($0)<b) b=length($0)
        }
        END{
                print maxlength=a
                print minlength=b
        }' file1

my OS is SunOS 5.10 Generic_150400-64 sun4v sparc sun4v

eval awk ...

Or (untested)

read maxlength minlength <<< $( awk '... END {print a, b}')