OK button calls unwanted routine--No code in OK button embed points. 
Author Message
 OK button calls unwanted routine--No code in OK button embed points.

Hi,

I have the following line of code in an routine--which gets called
when I press the OK button.

XYZ ROUTINE
CASE MESSAGE('Were all the records corrected?','Editing        |    
Question',ICON:Question, BUTTON:Yes+BUTTON:NO,BUTTON:YES,1)
     OF BUTTON:Yes
        !...statements...
     OF BUTTON:No
        MESSAGE('Remember to mark the months with errors!')
     END

It appears, to me, that my CASE MESSAGE('') statement is throwing me
off.  I have no idea why this routine gets called--the OK button has
no code in any of its embed points.  I've search around and haven't
found an answer.

If anyone can drop me a clue as to why this happens, I'd greatly
appreciate it--please forgive my igorance.

ClarionApprentice



Thu, 07 Jul 2005 06:52:38 GMT  
 OK button calls unwanted routine--No code in OK button embed points.

Quote:

> Hi,

> I have the following line of code in an routine--which gets called
> when I press the OK button.

> XYZ ROUTINE
> CASE MESSAGE('Were all the records corrected?','Editing        |    
> Question',ICON:Question, BUTTON:Yes+BUTTON:NO,BUTTON:YES,1)
>      OF BUTTON:Yes
>         !...statements...
>      OF BUTTON:No
>         MESSAGE('Remember to mark the months with errors!')
>      END

> It appears, to me, that my CASE MESSAGE('') statement is throwing me
> off.  I have no idea why this routine gets called--the OK button has
> no code in any of its embed points.  I've search around and haven't
> found an answer.

> If anyone can drop me a clue as to why this happens, I'd greatly
> appreciate it--please forgive my igorance.

> ClarionApprentice

If you'll don't mind my ignorance either, I'll go ahead and ask you a
stupid question. You aren't using any files, fields or screen
?elements (missing the ?) that are actually Clarion reserved words by
any chance, are you? That might be too obvious but it would be the
first possibility that I ruled out when hunting down the offending
bug.

- James



Sat, 09 Jul 2005 11:19:30 GMT  
 OK button calls unwanted routine--No code in OK button embed points.
the clarion tend to call all the accepted event for all controls in
the window after you press on the ok button.
Thus, all the coding writen under the accepted event of every control
will be called when you pree on the ok button, even though the coding
is not writen in the ok button

to avoid this , try to put the command:

IF FOCUS() <> ?OK
  !!coding here
END

hope can share my experience with you...



Sun, 10 Jul 2005 18:14:06 GMT  
 OK button calls unwanted routine--No code in OK button embed points.
Another way to do this is to use:

IF NOT 0{PROP:AcceptAll}
   ! put your code here.
END

the "0" is used to denote the current window.  This allows you to bypass
code during the 'non-stop select' mode for the window.
It is especially useful in the event that you are doing a lookup of data
from another file and you are updating multiple fields of data from the
lookup file.  This keeps the lookup from popping up during the saving of the
record.

--
Ben E. Brady
http://www.y2kbrady.com/diabetes/
Read the article... don't wait for the movie...


Quote:
> the clarion tend to call all the accepted event for all controls in
> the window after you press on the ok button.
> Thus, all the coding writen under the accepted event of every control
> will be called when you pree on the ok button, even though the coding
> is not writen in the ok button

> to avoid this , try to put the command:

> IF FOCUS() <> ?OK
>   !!coding here
> END

> hope can share my experience with you...



Sun, 10 Jul 2005 20:38:52 GMT  
 OK button calls unwanted routine--No code in OK button embed points.
Thank you!!!  This was exactly what I needed to know.  I was
suspecting that something like this was happening, but I hadn't seen
it in writing anywhere.  As temporary fix, I was using the following:

XYZ ROUTINE
  IF okNotPressed = TRUE
    CASE MESSAGE('Were all the records corrected?','Editing        |
    Question',ICON:Question, BUTTON:Yes+BUTTON:NO,BUTTON:YES,1)
     OF BUTTON:Yes
        !...statements...
     OF BUTTON:No
        MESSAGE('Remember to mark the months with errors!')
     END
  END

And, I set okNotPressed to FALSE when I pressed the OK button.

Quote:

> the clarion tend to call all the accepted event for all controls in
> the window after you press on the ok button.
> Thus, all the coding writen under the accepted event of every control
> will be called when you pree on the ok button, even though the coding
> is not writen in the ok button

> to avoid this , try to put the command:

> IF FOCUS() <> ?OK
>   !!coding here
> END

> hope can share my experience with you...



Sun, 10 Jul 2005 22:51:27 GMT  
 OK button calls unwanted routine--No code in OK button embed points.

Quote:

> Thank you!!!  This was exactly what I needed to know.  I was
> suspecting that something like this was happening, but I hadn't seen
> it in writing anywhere.  As temporary fix, I was using the following:

> XYZ ROUTINE
>   IF okNotPressed = TRUE
>     CASE MESSAGE('Were all the records corrected?','Editing        |
>     Question',ICON:Question, BUTTON:Yes+BUTTON:NO,BUTTON:YES,1)
>      OF BUTTON:Yes
>         !...statements...
>      OF BUTTON:No
>         MESSAGE('Remember to mark the months with errors!')
>      END
>   END

> And, I set okNotPressed to FALSE when I pressed the OK button.

Your Solution is good also...
but there is a little loop hole there...
If the user press on the ok button, but the is a field that cannot
pass the validation definded (if there is any), your flag
(okNotPressed) will set to FALSE as well, and the coding after that
won't be getting executed ever after even though you call the event to
execute it...


Mon, 11 Jul 2005 13:05:55 GMT  
 OK button calls unwanted routine--No code in OK button embed points.
yeah.. you won't find it in writing anywhere either... someone had to tell
me as well.. The documentation in this particular area of Clarion is the
pits....

--
Ben E. Brady
http://www.y2kbrady.com/diabetes/
Read the article... don't wait for the movie...


Quote:
> Thank you!!!  This was exactly what I needed to know.  I was
> suspecting that something like this was happening, but I hadn't seen
> it in writing anywhere.  As temporary fix, I was using the following:

> XYZ ROUTINE
>   IF okNotPressed = TRUE
>     CASE MESSAGE('Were all the records corrected?','Editing        |
>     Question',ICON:Question, BUTTON:Yes+BUTTON:NO,BUTTON:YES,1)
>      OF BUTTON:Yes
>         !...statements...
>      OF BUTTON:No
>         MESSAGE('Remember to mark the months with errors!')
>      END
>   END

> And, I set okNotPressed to FALSE when I pressed the OK button.




- Show quoted text -

Quote:
> > the clarion tend to call all the accepted event for all controls in
> > the window after you press on the ok button.
> > Thus, all the coding writen under the accepted event of every control
> > will be called when you pree on the ok button, even though the coding
> > is not writen in the ok button

> > to avoid this , try to put the command:

> > IF FOCUS() <> ?OK
> >   !!coding here
> > END

> > hope can share my experience with you...



Wed, 13 Jul 2005 15:26:28 GMT  
 OK button calls unwanted routine--No code in OK button embed points.
Check the DOCS for Select (no parameters).

Check Clarion Mag for articles on required fields.

Steve Parker

--------------------------------------------------
kb and download center at:
     www.par2.com
--------------------------------------------------

"The improbable, we do. The impossible takes a bit longer."


Quote:
> Hi,

> I have the following line of code in an routine--which gets called
> when I press the OK button.

> XYZ ROUTINE
> CASE MESSAGE('Were all the records corrected?','Editing        |
> Question',ICON:Question, BUTTON:Yes+BUTTON:NO,BUTTON:YES,1)
>      OF BUTTON:Yes
>         !...statements...
>      OF BUTTON:No
>         MESSAGE('Remember to mark the months with errors!')
>      END

> It appears, to me, that my CASE MESSAGE('') statement is throwing me
> off.  I have no idea why this routine gets called--the OK button has
> no code in any of its embed points.  I've search around and haven't
> found an answer.

> If anyone can drop me a clue as to why this happens, I'd greatly
> appreciate it--please forgive my igorance.

> ClarionApprentice



Mon, 18 Jul 2005 05:53:32 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Buttons: Mac OK, Windows not OK

2. I wanna do a play button using a .bmp on a ok button

3. How to code the OK and CANCEL buttons for a form

4. Accepting all fields with an OK button

5. Update Form, Validate fields before OK button?

6. Closing window half way through OK button using ABC/Update Templates

7. Clarion 5.5 PE OK button problem

8. C4 : OK and Cancel button

9. Problem with OK BUTTON

10. ok button problem

11. I need help With OK Button on an Update Form

12. Problem with OK button

 

 
Powered by phpBB® Forum Software