I often find myself writing things like this:
set x [mycommand ...]
if {$x ne ""} { ... }
I'd like to be able to do this instead:
iff {set x [mycommand ...]} { ... }
On 22/10/2025 10:50, Mark Summerfield wrote:
I often find myself writing things like this:
set x [mycommand ...]
if {$x ne ""} { ... }
I'd like to be able to do this instead:
iff {set x [mycommand ...]} { ... }
You are aware that `set` returns the new value of the variable? So you
can just do:
if {[set x [mycommand ...]] ne ""} { ... }
Schelte.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,090 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 193:22:44 |
| Calls: | 13,923 |
| Files: | 187,024 |
| D/L today: |
10,036 files (2,868M bytes) |
| Messages: | 2,456,382 |
| Posted today: | 1 |