Return code of command assigned to variable

How do I evaluate the result of a command assigned to a variable??

Example:

var1=`cmd`
rc=$?

rc will be the result of the assignment rather than cmd since it executes after. How do I evaluate the result of the command itself?

Cheers..:confused:

It should still be assigned to $?.

$ var1=`false`
$ echo $?
1
$ var1=`true`
$ echo $?
0
$

search for $? in here
Internal Variables
it has examples and all