tcl and NULL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

tcl and NULL

Rob Sciuk

While DRH is technically correct, it is possible to use coding convention
to drive a solution ...  trivially:

$ tclsh8.5
% proc x {} {
   return NULL
}
% puts [x]
NULL

for instance:

% proc recode { val } {
   set ret $val
   if { [string bytelength $val] == 0 } {
    set ret NULL
   }
   return $ret
}

% recode "a value"
a value

% recode ""
NULL

There are, of course many reasons why a null string is not equivalent to
NULL, but for many applications, the differences are moot.

I'm just saying ...

Cheers,
Rob Sciuk

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: tcl and NULL

Nicolas Williams-2
IMO the best solution is to have a special procedure passed to the Tcl
SQL function that must be called to set the return value of the SQL
function.

Nico
--
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users