Normal Topic Comparing Layout Element to Field Value (Read 685 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Comparing Layout Element to Field Value
Jan 19th, 2006 at 7:51pm
Print Post Print Post  
Hi -

Is there a command/function in Sesame that allows us to compare the value that is in a layout element to the value in the underlying field?

I remember that in Q&A I originally dealt with this by creating a "shadow field" so that I could compare the field I was working in, to the field in it's shadow, on field exit.   In other words I could have a First Name field and a "hidden" CurrentFirstName field.  The CurrentFirstName field might contain "Spencer."  If I start typing in the First Name field, the programming is not executed (because I haven't yet exited).  Even if I change Spencer to Spence ... but then change it back to Spencer, the programming would not be executed because "on exit" the two fields would be in agreement.  Only when, indeed, I made a change to the First Name field and exited the field, would the programming run.

It seems to me (and I may be wrong) that Q&A ultimately provided a command to enable us to do this ... where a "lookup" (to the "underlying" value) would be performed, comparing the two values, without the need for a shadow field.

If the command/function to do this does not currently exist (and, of course, I am hoping that it does), this would be a nice enhancement to the software.

Thanks!

  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Comparing Layout Element to Field Value
Reply #1 - Jan 19th, 2006 at 7:56pm
Print Post Print Post  
2.0 wil expose all attributes, including the undo value.

Meanwhile, if you want to compare a value to what it originally was when you arrived at the record, use a variable instead of a "shadow field". For example:

Global Code
----------------
stat vShadow as String

       vShadow = ""


On Form Entry
------------------
vShadow = LEToShadow


On Form Exit
-----------------
If vShadow <> LEToShadow
{
       @MsgBox("You changed the value!", "", "")
}
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Comparing Layout Element to Field Value
Reply #2 - Jan 19th, 2006 at 7:59pm
Print Post Print Post  
Erika -

Sounds like a "winner" and much better than a shadow field. 

I'm off to the "drawing board."

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Comparing Layout Element to Field Value
Reply #3 - Jan 19th, 2006 at 10:59pm
Print Post Print Post  
Erika -

Just to "close the loop," I want you to know that your recommendation worked like a charm and it is so much easier than creating shadow fields.

Now, if only life could always be this good.  lol

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Comparing Layout Element to Field Value
Reply #4 - Jan 20th, 2006 at 1:51pm
Print Post Print Post  
I'm glad it worked for you. Smiley

General note to the membership at large: Replacing "extra" fields with variables is one of the quickest and best ways to optimize your applications.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged