This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

can not unset var, no such var

Old posts that have not been replied to for several years.
Locked
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

can not unset var, no such var

Post by Dedan »

I seem to running into a problem with special characters
: = ¶ and who knows what other charcters.
all other lines are working just fine

Code: Select all

    if {![info exists rp_ctr($text)]} {set rp_ctr($text) 0}
    incr rp_ctr($text) 1
    utimer $rp_seconds [list rp:dec $text]



proc rp:dec {text} {
  global rp_ctr
  incr rp_ctr($text) -1
  if {$rp_ctr($text) <= "0"} {unset rp_ctr($text)}
  return 0
}

<Zipp> [23:32] Tcl error in script for 'timer395':
<Zipp> [23:32] can't read "rp_ctr(Away Duration: 10hrs 29mins 57secs «Log: ON»)": no such element in array

any ideas?

thanks for the help
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Re: can not unset var, no such var

Post by strikelight »

Dedan wrote:I seem to running into a problem with special characters
: = ¶ and who knows what other charcters.
all other lines are working just fine

Code: Select all

    if {![info exists rp_ctr($text)]} {set rp_ctr($text) 0}
    incr rp_ctr($text) 1
    utimer $rp_seconds [list rp:dec $text]



proc rp:dec {text} {
  global rp_ctr
  incr rp_ctr($text) -1
  if {$rp_ctr($text) <= "0"} {unset rp_ctr($text)}
  return 0
}

<Zipp> [23:32] Tcl error in script for 'timer395':
<Zipp> [23:32] can't read "rp_ctr(Away Duration: 10hrs 29mins 57secs «Log: ON»)": no such element in array

any ideas?

thanks for the help
The problem is not with the chars, it is with repeat calls to rp:dec via the utimer with the same text. Perhaps you should add a check to see if you already have a utimer call for the text in question?
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

this is happening even when the text is posted
1 time , other text works fine, i do see what you
are saying ... just tell me this,
how are you suppose to make a repeat
kicker without using a proc that unsets ALL vars?
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

If all you are after is a repeat kicking script, my norepeats.tcl is in the archive here, which you can take a look at.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

this is part of a 300 line script, this is the last bug.
I would like to find out why i am getting these
erors when the text is only posted 1 time,
and only when there are special charaters
in the text.
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Dedan wrote:this is part of a 300 line script, this is the last bug.
I would like to find out why i am getting these
erors when the text is only posted 1 time,
and only when there are special charaters
in the text.
Welp...
the error:
<Zipp> [23:32] Tcl error in script for 'timer395':
<Zipp> [23:32] can't read "rp_ctr(Away Duration: 10hrs 29mins 57secs «Log: ON»)": no such element in array
Is generated from your 'incr rp_ctrl($text) -1' call.... not the unset...

I would change your proc to:

Code: Select all

proc rp:dec {text} { 
  global rp_ctr
  if {[info exists rp_ctr($text)]} {
    incr rp_ctr($text) -1 
    if {$rp_ctr($text) <= "0"} {unset rp_ctr($text)}
  }
  return 0 
}
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

like i said before:
i am getting these erors when the text is only posted 1 time,
and only when there are special charaters in the text.
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Dedan wrote:like i said before:
i am getting these erors when the text is only posted 1 time,
and only when there are special charaters in the text.
Then I SUGGEST you give a different example, because the example you DID give does NOT contain any special characters that would result in any error.

Also, when the error occurs, doing '.tcl set errorInfo' in the partyline would also be of some benefit.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

edited
Last edited by Dedan on Mon Oct 20, 2003 6:34 pm, edited 2 times in total.
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

I still do not see a new example yet.... with the text that triggers the script, and with the generated error, and the output of '.tcl set errorInfo'....

are you sure you want help?
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

it happens when un-special characters
are in the text like ":" . ">>" , or "=)" are in the text
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

if i chage the "rp:dec" as you suggested
the error messages will stop, but the bug still remains.
and that is, the var is NOT being set when
those characters are present in the text.

any character that is not a-Z 0-9 seems to
stop the script from setting the var
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Dedan wrote:if i chage the "rp:dec" as you suggested
the error messages will stop, but the bug still remains.
and that is, the var is NOT being set when
those characters are present in the text.

any character that is not a-Z 0-9 seems to
stop the script from setting the var
I can tell you that is not the case... as you should see from your own code... the error was generated from the timer call... your variable IS being set, as your code:

Code: Select all

    if {![info exists rp_ctr($text)]} {set rp_ctr($text) 0} 
    incr rp_ctr($text) 1 
    utimer $rp_seconds [list rp:dec $text] 
did NOT generate any error for you. If it was NOT being set, your "incr" statement would be error'ing on you.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

this script is running now in a room with
100's of lines of text being read by the eggdrop.
there are NO error messages unless there are
characters as i described.
the error messages happen when the text is posted 1 time.

there is no other common denominator.
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Dedan wrote:this script is running now in a room with
100's of lines of text being read by the eggdrop.
there are NO error messages unless there are
characters as i described.
the error messages happen when the text is posted 1 time.

there is no other common denominator.
and yet we still have not seen the output of '.tcl set errorInfo' when an error occurs................. .......... .............. ..............
Locked