For Programmers: Free Programming Magazines  


Home > Archive > Clarion > July 2004 > PROP:Touched









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PROP:Touched
Nazla

2004-07-01, 3:55 am

Hi

I've got a 2 fields (FromDate and ToDate) where the user enters the date.
I've initialized it with today's date: Todate = Today( ). I've put the
following code on Todate on the embed point when Selected.

?Todate{PROP:Touched} = TRUE

There is some code which is suppose to execute when Todate is Accepted.
There are two seperate source codes that are suppose to execute when Todate
is accepted (the first part must execute before the second part). If the
user changes Todate (that is he does not use Today's date) and then TAB both
source codes execute. However, when he accept the date as it is (today's
date) and then hit the TAB button on the keyboard, only the first part
executes and the second part does not execute.

I was under the impression that if you use PROP:Touched on the embed point
'when selected' of the control all the code on the embed point 'when
accepted' will execute.

Can someone please tell me what I'm doing wrong.

Regards
Nazla


Vickie

2004-07-03, 8:55 am

Nazla,

Here's what I think you said:

1. You placed two code blocks on the same embed event, each having a
different priority (e.g., "first," and "default"),

2. If the user enters a date (i.e., doesn't just tab by the default of
today), both code blocks execute.

3. However, if the user does not enter a date and simply tabs by the date
field, one of the code blocks executes.

One scenario comes to mind: Consider the possibility that neither is
executing during focus, but during the non-stop wind-up pass, the first
block is executing and pre-empting the second block. This little Clarion
trick has caused many developers to scratch their heads. ;)

If this is the issue, try putting this condition around the code you don't
want to execute unless the user actually enters something:

If window {Prop:AcceptAll} = False
<put your code here>
End

Good luck,

Vickie

"Nazla" <nazlaa@otb.co.za> wrote in message
news:cc0cmo$ei8$1@ctb-nnrp2.saix.net...
> Hi
>
> I've got a 2 fields (FromDate and ToDate) where the user enters the date.
> I've initialized it with today's date: Todate = Today( ). I've put the
> following code on Todate on the embed point when Selected.
>
> ?Todate{PROP:Touched} = TRUE
>
> There is some code which is suppose to execute when Todate is Accepted.
> There are two seperate source codes that are suppose to execute when

Todate
> is accepted (the first part must execute before the second part). If the
> user changes Todate (that is he does not use Today's date) and then TAB

both
> source codes execute. However, when he accept the date as it is (today's
> date) and then hit the TAB button on the keyboard, only the first part
> executes and the second part does not execute.
>
> I was under the impression that if you use PROP:Touched on the embed point
> 'when selected' of the control all the code on the embed point 'when
> accepted' will execute.
>
> Can someone please tell me what I'm doing wrong.
>
> Regards
> Nazla
>
>



Vickie

2004-07-03, 3:55 pm

Hi again, Nazla,

Peering through the fog, I see something else in your message. My
understanding is that the "selected" event triggers whenever the control has
focus (e.g., when tabbed or hot-keyed to), whereas "accepted" event triggers
when the control is modified (e.g., when the user enters something). I don't
know why you'd need to use touched. Try embedding your code into "when
accepted, before generated code," rem out the touch test code and see what
happens.

Vickie

"Nazla" <nazlaa@otb.co.za> wrote in message
news:cc0cmo$ei8$1@ctb-nnrp2.saix.net...
> Hi
>
> I've got a 2 fields (FromDate and ToDate) where the user enters the date.
> I've initialized it with today's date: Todate = Today( ). I've put the
> following code on Todate on the embed point when Selected.
>
> ?Todate{PROP:Touched} = TRUE
>
> There is some code which is suppose to execute when Todate is Accepted.
> There are two seperate source codes that are suppose to execute when

Todate
> is accepted (the first part must execute before the second part). If the
> user changes Todate (that is he does not use Today's date) and then TAB

both
> source codes execute. However, when he accept the date as it is (today's
> date) and then hit the TAB button on the keyboard, only the first part
> executes and the second part does not execute.
>
> I was under the impression that if you use PROP:Touched on the embed point
> 'when selected' of the control all the code on the embed point 'when
> accepted' will execute.
>
> Can someone please tell me what I'm doing wrong.
>
> Regards
> Nazla
>
>



Nazla

2004-07-05, 8:55 am

Thanks Vickie, I'll take your advice and let you know.

Regards
Nazla

"Vickie" <Seahorse@Redshift.com> wrote in message
news:10ee1vickvrvuce@corp.supernews.com...
> Hi again, Nazla,
>
> Peering through the fog, I see something else in your message. My
> understanding is that the "selected" event triggers whenever the control

has
> focus (e.g., when tabbed or hot-keyed to), whereas "accepted" event

triggers
> when the control is modified (e.g., when the user enters something). I

don't
> know why you'd need to use touched. Try embedding your code into "when
> accepted, before generated code," rem out the touch test code and see what
> happens.
>
> Vickie
>
> "Nazla" <nazlaa@otb.co.za> wrote in message
> news:cc0cmo$ei8$1@ctb-nnrp2.saix.net...
date.[color=darkred]
> Todate
> both
point[color=darkred]
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com