| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri Sep 02, 2016 4:51 am Post subject: Sintax error in proc |
|
|
How I can invoke this process from another process ?
I have invoked the process in another code with name (addjss) , but I get the following error:
| Code: | proc addjss { } {
if {![file exists djnick]} { return }
set fname0 "djnick"
set fp [open $fname0 "r"]
close $fp
set data [read -nonewline $fp]
set lines [split $data " "]
set addjs [lindex $lines 0]
set tempo [lindex $lines 1]
set fechaa [lindex $lines 2]
if {![file exists listaDJS.txt]} {
set fs [open listaDJS.txt "w"]
puts $fs ""
close $fs
} else {
set fname "listaDJS.txt"
set fp [open $fname "a"]
puts $fp $addjs $tempo $fechaa
close $fp
}
} |
| Quote: | | wrong # args: should be "puts ?-nonewline? ?channelId? string" |
Do not copy the other process because it is very long.
But I think that I'm invoking wrong, I do not think that problem long process. _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Sep 02, 2016 8:01 am Post subject: |
|
|
Try changing this line... | Code: | | puts $fp $addjs $tempo $fechaa |
to something more like... | Code: | | puts $fp "$addjs $tempo $fechaa" |
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri Sep 02, 2016 8:18 am Post subject: |
|
|
| SpiKe^^ wrote: | Try changing this line... | Code: | | puts $fp $addjs $tempo $fechaa |
to something more like... | Code: | | puts $fp "$addjs $tempo $fechaa" |
|
Not work.
For debugging purposes I have added messages ( blue color code).
It shows: Exist file djnick!
| Quote: | proc addjss { } {
global canal_admin
if {![file exists djnick]} { putmsg $canal_admin "Does not exist file djnick!";return }
putmsg $canal_admin "Exist file djnick!"
set fname0 "djnick"
set fp [open $fname0 "r"]
close $fp
set data [read -nonewline $fp]
set lines [split $data " "]
set addjs [lindex $lines 0]
set tempo [lindex $lines 1]
set fechaa [lindex $lines 2]
if {![file exists listaDJS.txt]} {
putmsg $canal_admin "Does not exist file listaDJS!"
set fs [open listaDJS.txt "w"]
puts $fs ""
close $fs
} else {
putmsg $canal_admin "Exist file listaDJs!"
set fname "listaDJS.txt"
set fp [open $fname "a"]
puts $fp "$addjs $tempo $fechaa"
close $fp
}
} |
Now the error is:
| Quote: | | can not find channel named "file416" |
_________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Sep 02, 2016 8:45 am Post subject: |
|
|
Change this... | Code: | set fp [open $fname0 "r"]
close $fp
set data [read -nonewline $fp] |
to... | Code: | set fp [open $fname0 "r"]
set data [read -nonewline $fp]
close $fp
|
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri Sep 02, 2016 2:19 pm Post subject: |
|
|
It worked perfect.
Thanks SpiKe^^. _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
|