Subject Re: about returning value from msgBox
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Wed, 7 Aug 2019 18:59:31 +0530
Newsgroups dbase.getting-started

On 07/08/2019 18:03, Ivan Benttini wrote:
> when my form open and object called EDITOR1 is not visible, it hides information about that person, only to be realese to supervisors per exemple.
>
> A message is displayed with an YES  NO  option
> By clicking the YES option, EDITOR1 content should be visible to the USER.
>
> By clicking the NO option, EDITOR1 content SHOULD NOT be visible to the USER.
>
>                example of the line of code below
> cAnswer= MSGBOX("Do YOU have permission to see this type of Information","Alert", 4+32)
>  
>                 cAnswer should return 6 for YES and 7 for NO
>  
>                
>                 error message below when user click option YES,
>                 Error:  Data type mismatch.  Expecting:  Object
>        
>                 NO error message when user click option NO.
> Can someone tell me what I am doing wrong?

A very unusual error.

I ran
cAnswer= MSGBOX("Do YOU have permission to see this type of
Information","Alert", 4+32) in command window and got expected result.

Are you sure the line number being pointed out in the error is for
msgbox only As the error message does not match with msgbox().

Just after the msgbox line insert a line
?"Out of messagebox" ,canswer
or
msgbox("previous msgbox okay" + str(canswer,2,0))

If all okay then shift it a few lines down.
It will help in locating the error.

Some other locations of msgbox("All okay till here") could be just
before and after the if condition where you check the value of cAnswer.

I would not be surprised if it is a typo.
All of us have at sometime or the other gone down that lane.

Regards
Akshat