mr_suleyman
20th November 2006, 13:40
I wonder something. On form , I want to check value of form field when user inputs one character at the sametime. I don't mean after.input or check.input event. For example I have a long type field on form. User starts to enter her value. When user enter non digit value like "a" "." I want to give message at the same time and reset field value.

Is there way to check it at the sametime ?


Thanks in Advice.

mark_h
20th November 2006, 14:17
Search this forum for in.ret - I think this might do what you are asking.

mr_suleyman
20th November 2006, 16:00
It only runs after check my input or getting my all input. I want to run for each one of myinput. For example I want to write BAAN.
When I enter B it should give me message. My aim is to check each value of my input.

Thanks ...

george7a
20th November 2006, 16:04
Hi,

You can use a timer. After defining one, you can type your function under the "interrupt" choice so that every predefined period of time your function will check/do whatever you want.

Check the timer examples in the following threads:
http://www.baanboard.com/baanboard/showthread.php?t=22946
http://www.baanboard.com/baanboard/showthread.php?t=7565
http://www.baanboard.com/baanboard/showthread.php?t=6033

I hope it helps,

- George

mark_h
20th November 2006, 17:32
It only runs after check my input or getting my all input. I want to run for each one of myinput. For example I want to write BAAN.
When I enter B it should give me message. My aim is to check each value of my input.

Thanks ...
Yep - you are right. See what George posted. The only other thing I can thing of is to write your own form and input functions(key press, next event, etc). I know it can be done, but not worth all the work to me.

mr_suleyman
21st November 2006, 08:12
George What do you mean with interrupt choice ? I have only form field.
Could you send simple sample to me ?

Thanks

george7a
21st November 2006, 10:28
mr_suleyman ,

In the links I posted there are many examples:

here is one:

long timer

before.program:
timer = set.timer(500)

choice.interrupt:
on.choice:
Check.My.Fields() | You have to wirte this function manually. It will be activated twice in a second


- George

mr_suleyman
21st November 2006, 11:16
Thanks George but
I write simple test script
before.program:
timer = set.timer(2000)

choice.interrupt:
on.choice:
message("TEST:%d",test)
if test = 1 then message("1") endif

if test = 12 then message("12") endif
test is my form field.When I run the session it starts to give message contuniously but When I try to enter value to TEST field my timer goes away,
it doesn't give me any message. What can be reason of this ?

Thanks

george7a
21st November 2006, 16:26
I noticed that the timer "hangs" whenever I change the focus. I tried to kill the old one (using kill.timer()) and activate a new timer inside the field sections but it didn't work!

Still you can do as Mark suggested:
The only other thing I can thing of is to write your own form and input functions(key press, next event, etc). I know it can be done, but not worth all the work to me.

- George

mr_suleyman
21st November 2006, 16:42
I think that in this condition it will not work for other solutions.

dorleta
22nd November 2006, 11:31
Perhaps:
in ret return the integer value of the key pressed on input field. Watch help predefined variables. This can be an example:


on.input:
if in.ret = CTRL.R then
tiedm.dll0001.search.revision(tdsls4102.edm.cprj(),
tdsls041.item,
tdsls041.odat,
itm.umer,
tdsls041.revi)
display("tdsls041.revi")
endif

good luck

mr_suleyman
22nd November 2006, 11:38
It doesn't work for my case.

mr_suleyman
22nd November 2006, 17:35
I am still waiting your suggestions ...

nidyar
23rd November 2006, 13:29
May be Keypress events will help?

EVTKEYPRESS

evt.keypress.key( event ) ASCII or TSS value of pressed key.
evt.keypress.state( event ) Indicates which modifier keys are held down while the key is being pressed. Possible values are:
MOD_CTRL
MOD_SHIFT
MOD_ALT

and then validating the key pressed. if validated you can concat to the required field. or validation message. Form field being entered need not be focused while editing.
I can see the possibilities. But I am not sure.