Hot Topic (More than 10 Replies) On Form Exit Programming (Read 1406 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
On Form Exit Programming
Nov 18th, 2005 at 5:48pm
Print Post Print Post  
Hi -

I was hoping that "on form exit" programming  (which is a new feature for me) would execute before the form is exited; however either it does not do this, or I am overlooking something.

Here is the code I am using:

Code
Select All
If @isblank(first name) and not status = "Incomplete"
then
{
@msgbox("You must either enter something in the first name field","or enter 'incomplete' in the status field","")
throwfocus(Status)
}
 



Unfortunately, this does not work.  If I press F10, I am simply presented with the next record.

If I enter it in "on form change" it works correctly; however it works "prematurely."  I can't use it in any of the other options (such as on element exit) because there is no particular point when I want to be notified except when I am trying to leave the form.

How do I fix this please, to accomplish what I want?

Thanks!

P.S.  I just discovered another flaw in my programming.  If I place it in "on form change" it will not execute repeatedly.  In other words, if I enter 'Incomplete' in the status field and then remove it, it will allow me to continue without giving me the message box again.  This is not acceptable, because it will then allow me to advance to the next record, without a required entry.


  

- Spencer

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



Posts: 2530
Joined: Nov 22nd, 2002
Re: On Form Exit Programming
Reply #1 - Nov 18th, 2005 at 6:27pm
Print Post Print Post  
Try using NotifyForm to prevent the form from advancing. Also, use Writeln to make sure that your conditions are correct.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: On Form Exit Programming
Reply #2 - Nov 18th, 2005 at 6:58pm
Print Post Print Post  
Quote:
"on form exit" programming  (which is a new feature)
???   ???   ???

Spencer, I have been using that for years in Q&A.  A critical tool to use when doing Posting and Mass Updates.

Just a reminder:  This is the equivalent of using the On Exit Field for programming.  That comes up in the Q&A Programming when pressing F8.  I am sure that you must have used this before.


  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: On Form Exit Programming
Reply #3 - Nov 19th, 2005 at 1:07am
Print Post Print Post  
Hi -

I'm back and trying to get this worked out.

Attn: Bob (but Mark and everyone else is welcome to read it too (lol)

Now that you mention it, I vaguely remember using F8 in Q&A; however, it may not have been in this type of situation.  In any event, it has been so long since I've used Q&A that - unless I remember programming "format" or "structure" (that makes programming in Sesame easier for me, without having to look up the correct syntax in Sesame) - then having used it in Q&A is simply of no value to me (nor do I care - lol). The bottom line is that I am reading the Sesame programming documentation and I am not able to accomplish what I want (and I need to).

Attn: Mark (but Bob and everyone else is welcome to read it too (lol)

I was not familiar with the Notifyform option and that has helped me move a little closer.  The form does not advance unless the conditons are satified. First, here is the code I am currently working with and it is back in the "on form exit" event.

Code
Select All
If @isblank(first name) and not status = "Incomplete"
then
{
notifyform(1)
@msgbox("You must either enter something in the first name field","or enter 'incomplete' in the status field","")
throwfocus(Status)
}

if status = "Incomplete" or not @isblank(first name)
then
notifyform(0)
 



If either condition exists, the form behaves exactly as I want it to and I can advance to the next record.

If, however, either condition is not satisfied, I do get the appropriate message and the form does not advance until either one of the conditions are satisfied (which is precisely what I want); however:

1) Throw focus does not take me back to the status field.  

2) What advantage is there to using writeln to tell me the conditions are met (since I prefer not to have extraneous information appear on the form unless it is necessary).

a)  If the condition is not satisfied, I get my notice and the opportunity to correct it. Once it is correct, I am then able to advance to the next form.

b)  If the condition is satisfied, I simply advance to the next form, which is what I want to do.

Once again, if I am overlooking something I would like to learn.  The bottom line (in my mind) is that if something is done correctly, I don't need confirmation of that fact. It is only when something is not done correctly that I need to be alerted.

Eagerly looking forward to the "solution" so that I can continue with other programming.

Thanks!
  

- Spencer

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: On Form Exit Programming
Reply #4 - Nov 19th, 2005 at 2:00am
Print Post Print Post  
Quote:
1) Throw focus does not take me back to the status field.

I'm pretty sure this is a bug, and that it is supposed to be fixed in 1.1.3

Quote:
2) What advantage is there to using writeln to tell me the conditions are met (since I prefer not to have extraneous information appear on the form unless it is necessary).

I think Mark simply meant to use it as a temporary diagnostic tool, not to leave it that way permanently.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: On Form Exit Programming
Reply #5 - Nov 19th, 2005 at 12:46pm
Print Post Print Post  
Indeed, I meant that in particular. The Writeln command will popup a separate window that can be written into pretty much freely. It is very useful for debugging programming in that it does not affect your form, and once the programming is okay, you can remove the writeln statement easily.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: On Form Exit Programming
Reply #6 - Nov 19th, 2005 at 4:40pm
Print Post Print Post  
Hi -

As for writeln, now I understand that it was not intended as part of the "permanent" coding.

With regard to "debugging," whenever I attach new programming, I always test it (now, first in preview mode - thanks to the help of Bob Hansen) and again in the actual database.  I usually just ad a "test" form and intentionally, first add the "correct" conditions and then test each "problem" situation, so I already know the content of the fields.  I can see, however, where writeln might come in handy, especially in more complex situations, so thank for pointing it out.  I will have to start "playing" with it a little more to get more accustomed to it.

As for the "bug" regarding throwfocus, you don't sound absolutely certain, Carl, either that (1) it is indeed a bug and (2) that it will be fixed in version 1.3.  Confirmation (if it's true) or another explanation would be very much appreciated.

It's especially important to me, now, because I am adding another "condition" to my programming and seem to be having a problem getting it to work correctly.  I'll keep at it and if I can't figger it out on my own, will post the code here.

Thanks!
  

- Spencer

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: On Form Exit Programming
Reply #7 - Nov 19th, 2005 at 7:28pm
Print Post Print Post  
Quote:
As for the "bug" regarding throwfocus, you don't sound absolutely certain, Carl, either that (1) it is indeed a bug and (2) that it will be fixed in version 1.3.  Confirmation (if it's true) or another explanation would be very much appreciated.


If you need to be certain, ask Ray to test it in the the latest build they have.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: On Form Exit Programming
Reply #8 - Nov 20th, 2005 at 5:05pm
Print Post Print Post  
Ray -

I trust that you've been watching this and really would appreciate knowing:

1) Whether indeed there is a bug with throwfocus in version 1.1.2 ....    or

2) Whether I am overlooking something in my programming  ... and

3) If there is a bug in version 1.1.2, has it been (or will it be) fixed in version 1.1.3. ..... and

4) Any idea on when version 1.1.3 will be ready for dowload? ... and just cuz everyone would like to know

5) Any prediction on about when version 1.2 will be ready for release?

Thanks!
  

- Spencer

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



Posts: 2530
Joined: Nov 22nd, 2002
Re: On Form Exit Programming
Reply #9 - Nov 20th, 2005 at 8:23pm
Print Post Print Post  
Quote:
Ray -

I trust that you've been watching this and really would appreciate knowing:

Actually Ray is off visiting. He'll be back Monday.
Quote:
1) Whether indeed there is a bug with throwfocus in version 1.1.2 ....    or

2) Whether I am overlooking something in my programming  ... and

3) If there is a bug in version 1.1.2, has it been (or will it be) fixed in version 1.1.3. ..... and

One of the 1.1.3 Alpha testers reports that there was a bug associated with ThrowFocus and On Form Exit events. He also confirms that it has been fixed in 1.1.3.
Quote:
4) Any idea on when version 1.1.3 will be ready for dowload? ... and just cuz everyone would like to know

We have a go ahead from alpha and from Lantica marketing to start packing it up. But it really isn't up to development (or support) to set the final date.
Quote:
5) Any prediction on about when version 1.2 will be ready for release?

Version 1.2? Do you mean 2.0?

As far as I know there are no plans for a 1.2.

2.0 Runtime has pretty much reached critical mass and should be going into a test cycle soon. There are quite a few SDesigner features we would like to add before it gets locked down. After both developments are locked, both will have to go through testing and docs, then marketing will do its voodoo on price and product position, and make decisions about 1.x support and features.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: On Form Exit Programming
Reply #10 - Nov 20th, 2005 at 8:42pm
Print Post Print Post  
Thanks Mark -

That about covers it. 

And, yes, I did mean (my last question) version 2.0

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged