How to bypass SAM_Validate

Discussions specific to Team Developer 5.1.

How to bypass SAM_Validate

Postby giggs11x » Wed Jul 13, 2011 7:30 pm

I have a button (e.g pbExit) which destroy a window. However, this window has a particular field which contain SAM_Validate.

Inside the SAM_Validate I did check for wParam = SalWindowHandleToNumber( pbExit ) and set to Validate_Ok
However, when pbExit is clicked, it went through a series of code and whenever it reaches the field SAM_Validate, the wParam is no longer from pbExit.

Any work around for this to force the wParam?

Thanks in advance.
giggs11x
 
Posts: 2
Joined: Wed Jul 13, 2011 6:39 pm

Re: How to bypass SAM_Validate

Postby Jeff Luther » Fri Jul 15, 2011 3:17 pm

set to Validate_Ok

You don't 'set' that constant (it's 'VALIDATE_Ok'), your code has that as the return value (or one of other VALIDATE_xxx constants), like this:
Code: Select all
On SAM_Validate
    If <some condition where we bypass validation = TRUE>
        Return VALIDATE_Ok
    Else
        ....


That's how you have the code ignore. BTW, you never set the wParam or lParam values. TD assigns those internally based on the current message. Your code uses/evaluates, etc. either/both wParam/lParam values, based on the msg.
Jeff Luther
 

Re: How to bypass SAM_Validate

Postby giggs11x » Fri Aug 05, 2011 2:50 am

Sorry for the wrong terminology, I did do the bypass but is by using the wParam

Code: Select all
If wParam = SalWindowHandleToNumber( pbExit )
        Return VALIDATE_Ok


That I return validate_ok whenever the button is clicked. But however there's some button which after clicked, it prompt another message box and it doesn't get into the SAM_Validate yet. When it gets there after 'OK' button from the message box the wParam is no longer the number to the pbExit.

Any better suggested way?

Thanks.
giggs11x
 
Posts: 2
Joined: Wed Jul 13, 2011 6:39 pm

Re: How to bypass SAM_Validate

Postby Jeff Luther » Wed Aug 10, 2011 1:41 pm

But however there's some button which after clicked, it prompt another message box and it doesn't get into the SAM_Validate yet. When it gets there after 'OK' button from the message box the wParam is no longer the number to the pbExit.

Sounds like some confusion still about SAM_Validate:

** Per TD help file: ""Sent to a Data field, multiline field, combo box, and column when the user changes the value of the object and then moves the focus away from the object."
That is, 2 points:
1 - it is only sent to a control that can be editable, like a data field etc. "the wParam is no longer the number to the pbExit" -- then this means that SAM_Validate wasn't just sent

2 - it is only sent 1 time if/when the field is edited and user moves focus to another control (like a button). if the user then clicks back on the field *BUT* does not edit it again, and then clicks the button again the msg. will not be sent (it only sent that 1 time when edited and focus leaves).

Read TD Help for more details on this msg. Otherwise, I stronly suggest you write a small test case appl. with code for a field or two, the SAM msg, a pb, etc. to figure this out. And if you cannot you at least still have a small test app. you can zip/rar and attach with a specific question.
Jeff Luther
 


Return to Team Developer 5.1

Who is online

Users browsing this forum: No registered users and 1 guest

cron