KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

KeyCode and OnKeyDown

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
shinji
KiXforms Novice
KiXforms Novice


Joined: 27 Apr 2004
Posts: 1

PostPosted: Tue Apr 27, 2004 8:51 am    Post subject: KeyCode and OnKeyDown Reply with quote

Hi there,
Good job Shawn on KiXforms. I extensively use it for every piece of program I do. Great!

Question: I wonder if there is a way to shorten this:
Code:
$field.OnKeyDown = 'CheckKey()'
Function CheckKey()
  If $field.KeyCode = 27
    $field.Text = ""
  EndIf
EndFunction


To something like this:
Code:
$field.OnKeyDown(27) = '$$field.Text = "" '


It would shorten the code a lot!

Any way to implement that, or does it exist already?
Back to top
View user's profile Send private message
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Wed Apr 28, 2004 6:45 am    Post subject: Reply with quote

Well, it would shorten only if you need to watch a single key Confused Wink

you can of course in this case do this :

Code:
$field.OnKeyDown = 'if $$field.Keycode=27 $$field.Text="" endif'


short enough ?

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Apr 28, 2004 12:39 pm    Post subject: Reply with quote

An important addition to Jochen comments, because event properties are properties (and not methods), this particular syntax here:

$field.OnKeyDown(27) = '$$field.Text = "" '

specifically this bit here

(27) =

is not supported by Kixtart ... Kixtart can't set a property that has parameters ... already discussed this with Ruud (the Kixtart developer) long, long time ago and he doesn't seem eager to "fix" this (its not broken, just not supported) ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group