set_option_from_tv(char_u *varname, typval_T *varp)
{
    long	numval = 0;
    char_u	*strval;
    char_u	nbuf[NUMBUFLEN];
    int		error = FALSE;

    if (varp->v_type == VAR_BOOL)
    {
	numval = (long)varp->vval.v_number;
	strval = (char_u *)"0";  // avoid using "false"
    }
    else
    {
	if (!in_vim9script() || varp->v_type != VAR_STRING)
	    numval = (long)tv_get_number_chk(varp, &error);
	strval = tv_get_string_buf_chk(varp, nbuf);
    }
    if (!error && strval != NULL)
	set_option_value(varname, numval, strval, OPT_LOCAL);
}
set_option_from_tv(char_u *varname, typval_T *varp)
{
    long	numval = 0;
    char_u	*strval;
    char_u	nbuf[NUMBUFLEN];
    int		error = FALSE;

    if (varp->v_type == VAR_BOOL)
    {
	numval = (long)varp->vval.v_number;
	strval = (char_u *)"0";   
    }
    else
    {
	if (!in_vim9script() || varp->v_type != VAR_STRING)
	    numval = (long)tv_get_number_chk(varp, &error);
	strval = tv_get_string_buf_chk(varp, nbuf);
    }
    if (!error && strval != NULL)
	set_option_value(varname, numval, strval, OPT_LOCAL);
}