dp_variable_type varname
Returns the datatype for $varname (really only reads the fourth part of th variable name)
Source code:
return [lindex [split $varname .] 3]