so, here goes with an example:
$artist = "wang chung"
$song = "Dance Hall days"
a template file named "playlist.tpl" contains:
"$artist - $song"
now we set it up...
Code: Select all
if {([file exists "/path/to/playlist.tpl"])} {
set TmpPL "[read [open "/path/to/playlist.tpl" r]]"
} else {
putlog {WARNING - Playlist Template File Not Found!}
}
Now, I have a proc that generates $artist and $song and I want them to be "inserted" into $TmpPL where $artist = "wang chung" and $song is "dance Hall days" this changes dynamically.. and will be called to do so every 2 seconds...
if I did it "manually" from in the proc; say:
Code: Select all
set TmpPL "$artist - $song"
the only part I'm stuck on is how to "replace" or "insert" the varables from a proc internally into an external file and load it as a new varable...
PHP calls this a passthru TCL has NO such function that I can find or figure out..
-DjZ-

