Key Release binding

From: Shamil D. (shamild_at_hotmail.com)
Date: 04/01/04


Date: 1 Apr 2004 08:35:46 -0800

I have an application in which the user enters customer ID and then
that customer's name and other information is automatically displayed
in adjacent entries. I want the user to be able to enter two customer
IDs in one screen. However, I'm finding some awkward behavior when
using a "KeyRelease" binding inside a loop. The "set var $ent($j)"
command fails because for some reason j is incremented to 3. Any idea
why it's doing that?

Below is a simplified code that reproduces the error.

Shamil D.

#-------------- begining of code --------------

for {set j 1} {$j <= 2} {incr j} { ;# open brace 1
entry .e$j -textvariable ent($j)
entry .r$j -textvariable res($j)
entry .n$j -textvariable nop($j)

pack .e$j .r$j .n$j

bind .e$j <KeyRelease> {
     set var $ent($j)
     if {[string length $var] == 3} {
        if {[info exists who($var)]} {
            set res($j) $who($ent($j))
            set nop($j) $age($ent($j))
            }
     } else {
            set res($j) {}
            set nop($j) {}
            }
  }

} ;# close brace 1

set who(100) Joe; set who(200) Sam; set who(300) Kevin;
set age(100) 26; set age(200) 33; set age(300) 15

#---------------- end of code ----------------



Relevant Pages

  • Sorting with multiple rows grouped
    ... I have a list of customer part numbers and ... part number entries, but all three rows for each entry would need to ... Is it possible to group rows like this? ...
    (microsoft.public.excel.programming)
  • Re: Not to print blank fields
    ... Well, typically if you have up to five entries for an item, and each entry ... can enter one or more notes per "customer". ... I have in my designed report 5 fields, say Note1, Note2 and so on. ...
    (microsoft.public.access.reports)
  • Re: Cookies & Sessions
    ... ProductID) to a MySQL database for every product the user adds to the ... when the first item is added to the cart, ... entries where people started the shopping process but never completed ... the customer got before bailing out - is there a particular sticking ...
    (uk.net.web.authoring)
  • Re: Filter address book on PR_EMS_AB_HOME_MDB
    ... row at a time from the addressbook, and doing a seek past the one which ... > Guess I'll have to bring my laptop to the customer and do some live ... > My two other options so far seems to be one entry at a time with SeekRow ...
    (microsoft.public.win32.programmer.messaging)
  • RE: MDX Get most recent with time dimension
    ... because we don't know the last entry until some time after the last entry is ... you would do, on your facts, prior to your olap cube. ... I have a simple tracking cube with one fact table and three dimensions: ... Customer, Tracking, and Time. ...
    (microsoft.public.sqlserver.olap)