Re: Best Practices Issue
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Feb 08, 2003
- 452 views
Ok, Thinking about Kat's observation, maybe you could create an "invisible" (off-screen?) check-box control, and *change* that whenever your variable changes; then you could use an "onChange" event trap for the check-box to re-set the text to what the variable has? Dan Moyer ----- Original Message ----- From: <gertie at visionsix.com> To: "EUforum" <EUforum at topica.com> Subject: Re: Best Practices Issue > > On 7 Feb 2003, at 18:21, Dan Moyer wrote: > > > > > C.K., > > > > You could set a timer to check the variables? But I'd check first to be > > *sure* there's no event you could trap. > > In mirc, i trap /msg and /set > > In this way, and with mirc's ability to know the names of the vars (see the Eu > associated lists in the Eu archives), i can know what the code sent to > channels or people, and decide what to do to other vars when any one var is > set. I pulled off some programming tricks that stunned Khaled (i know this > because he asked me how i did it, because it alledgedly wasn't possible). > That was without disclosing any self-modifying scripts. I know people will > reject this suggestion again, but haveing mirc and Eu features in one > language would be dynamite. I can keep on doing things like that in mirc tho, > and use Eu only when hitting a mirc shortcoming. > > Kat > > > > > Dan Moyer > > > > ----- Original Message ----- > > From: "C. K. Lester" <cklester at yahoo.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Friday, February 07, 2003 10:29 AM > > Subject: Re: Best Practices Issue > > > > > > > > I will typically use the value directly from the control if I only need to > > > > reference the value 1 or 2 times top. > > > > > > > > If I need to reference the value in another routine (maybe with a global > > > > variable) or need to reference the value more than 2 times within a function > > > > I'll assign to a variable. This reduces clutter, makes the code easier to > > > > read and also allows me to ? the value of the variable in debug. It also > > > > helps with performance as you're not having to call getText() multiple > > > > times. > > > > > > Hey, Jonas, thanks for the response. Here's a follow-up for you (and > > anybody > > > else who wants to chime in): what do you do if a value changes in your > > > variable, but not as a result of the control itself? For example, let's > > say > > > we have txt_Total (a text box that is uneditable by the user and whose > > value > > > is equal to the sum of four other text boxes). Let's say you've decided to use > > > variables to track your control values (or rather, control values are > > > determined by certain variables). When do you check for and update the control > > > value? Basically, how do you update control values based on variables that > > > have no onChange() event? > > > > > > > > > TOPICA - Start your own email discussion group. FREE! > > > > > > > TOPICA - Start your own email discussion group. FREE! > > > > > > TOPICA - Start your own email discussion group. FREE! >