Normal Topic IgnoreKey and ClearIgnoreKey (Read 10988 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
IgnoreKey and ClearIgnoreKey
Sep 18th, 2007 at 9:17pm
Print Post Print Post  
Will one ClearIgnoreKey() command clear the ignores for 2 states of the key?  To be specific, is the following correct?
Code
Select All
// Disables use of the F10 key if the Bill To Code has not been assigned
IF ( (@Mode() = 0) AND (@IsBlank(BILL_TO_CODE)) )
THEN
	{
	IgnoreKey(KEYCODE_F10, 0)
	IgnoreKey(KEYCODE_F10, KEY_STATE_SHIFT)
	}
ELSE
	{
	ClearIgnoreKey(KEYCODE_F10)
	} 

  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: IgnoreKey and ClearIgnoreKey
Reply #1 - Sep 18th, 2007 at 9:24pm
Print Post Print Post  
Infinity wrote on Sep 18th, 2007 at 9:17pm:
Will one ClearIgnoreKey() command clear the ignores for 2 states of the key?

Yes.

Quote:
To be specific, is the following correct?

Whether it is correct depends on whether you are trying to clear both ignore states. If you are, then it is correct.
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: IgnoreKey and ClearIgnoreKey
Reply #2 - Sep 18th, 2007 at 9:25pm
Print Post Print Post  
Thanks Erika!
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: IgnoreKey and ClearIgnoreKey
Reply #3 - Sep 18th, 2007 at 9:28pm
Print Post Print Post  
BTW, if you are trying prevent saving, NotifyForm(1) is much more reliable.
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: IgnoreKey and ClearIgnoreKey
Reply #4 - Sep 18th, 2007 at 9:36pm
Print Post Print Post  
Here's what I'm dealing with.  I have buttons on my form for Save, Save & Continue, and Save & Exit.  Each of these tests to see if the Code has been assigned before committing the record.  If it has not, NotifyForm(1) prevents saving.  When the code is assigned the record is automatically committed, and the button which assigns the code no longer functions.

The other day my trucking dispatcher pressed F10 while working on a record in Add mode.  The F10 key performs no test to check if the code has been assigned, and it had not.  So now we had a committed record without a code.  And I couldn't assign the code because it had been committed.  And we couldn't save the record with the buttons because the code hadn't been assigned.  Yadda yadda yadda.  Had me darned confused for a while:  how the heck had she done that?

So I'm disabling F10 in Add mode if the code has not been assigned.  I'm sure there's a less blunt way to do it but what the heck, the programming is top-heavy already.
  

**
Captain Infinity
Back to top
IP Logged