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: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 21:25:45 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
6 files (8,794K bytes) |
| Messages: | 186,211 |
| Posted today: | 1 |