From 63853899de48eec84718fac91487c0f0da439f40 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 12 Nov 2011 05:41:02 +0000 Subject: handle any message as a file name svn path=/trunk/externals/tclfile/; revision=15730 --- exists.tcl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'exists.tcl') diff --git a/exists.tcl b/exists.tcl index fed8da3..53a4918 100644 --- a/exists.tcl +++ b/exists.tcl @@ -1,6 +1,15 @@ package require Tclpd 0.2.3 package require TclpdLib 0.19 +proc exists::make_symbol {argslist} { + set output [pd::strip_selectors $argslist] + set selector [lindex $output 0] + if {$selector eq "list" || $selector eq "float"} { + set output [lrange $output 1 end] + } + return $output +} + proc exists::constructor {self args} { if {![namespace exists $self]} { namespace eval $self {} @@ -22,6 +31,12 @@ proc exists::0_symbol {self args} { exists::0_bang $self } +proc exists::0_anything {self args} { + # HOT inlet + variable ${self}::filename [make_symbol $args] + exists::0_bang $self +} + proc exists::0_bang {self} { variable ${self}::current_canvas variable ${self}::filename @@ -38,4 +53,9 @@ proc exists::1_symbol {self args} { variable ${self}::filename [pd::arg 0 symbol] } +proc exists::1_anything {self args} { + # COLD inlet + variable ${self}::filename [make_symbol $args] +} + pd::class exists -- cgit v1.2.1