Message box popping up in middle of a run

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
drhoward
Posts: 22
Joined: Tue Dec 10, 2013 9:03 am

Message box popping up in middle of a run

Post by drhoward » Wed Apr 29, 2015 10:26 am

I wrote a program that appears to be working properly. However, a single line message box keeps popping up and I can't find out why. I've pinned it down to the execution of a single line of code.

Here is the section of code that contains that line: I've used the editor for this blog to highlight the line. It's the one using the binaryDecode function. I suspect that I've done something wrong in the syntax, but the code seems to work. Will somebody please help.

put 0 into currentCount
if pFirstTimeFlag = true then
put sNumData * 4 into byteCount
put binaryEncode ("I", byteCount) into byte 41 to 44 of wavWrite
else
answer "currentCount = " & currentCount & " byteCount = " & byteCount
put binaryDecode("I",byte 41 to 44 of wavWrite,currentCount) -- number of bytes of data prepared in previous passes
put currentCount + byteCount into byteCount -- number of bytes of data that will have been prepared in this pass
answer "byteCount = " & byteCount & " currentCount = " & currentCount
end if

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Message box popping up in middle of a run

Post by Dixie » Wed Apr 29, 2015 11:44 am

drhoward..

Just comment out this line... You are putting the result but not stipulating where, so it pops into the message box..:-)

Code: Select all

--put binaryDecode("I",byte 41 to 44 of wavWrite,currentCount) -- number of bytes of data prepared in previous passes
for example..

Code: Select all

put binaryDecode("I",byte 41 to 44 of wavWrite,currentCount) into myVariable
This now would place the result into the variable myVariable and not into the messagebox

drhoward
Posts: 22
Joined: Tue Dec 10, 2013 9:03 am

Re: Message box popping up in middle of a run

Post by drhoward » Wed Apr 29, 2015 4:38 pm

Thank you! This worked. It was not clear to me from the dictionary writeup that the result flag would be handled in this manner.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Message box popping up in middle of a run

Post by dunbarx » Wed Apr 29, 2015 5:01 pm

Hi.

This is old behavior. From the dictionary:
If you do not specify a container, the put command puts the value into the message box.
Very useful, but unless you know about it, very annoying. It is entirely academic, unless you are into that sort of thing, but if you think about it, if no container is specified, where would the value go?

Craig Newman

Post Reply