egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sintax error in proc

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Fri Sep 02, 2016 4:51 am    Post subject: Sintax error in proc Reply with quote

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 Smile
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Fri Sep 02, 2016 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Fri Sep 02, 2016 8:18 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Fri Sep 02, 2016 8:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Fri Sep 02, 2016 2:19 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber