Added routine res_get_int which returns resource value as int.