Page 1 of 1

Message box popping up in middle of a run

Posted: Wed Apr 29, 2015 10:26 am
by drhoward
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

Re: Message box popping up in middle of a run

Posted: Wed Apr 29, 2015 11:44 am
by Dixie
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

Re: Message box popping up in middle of a run

Posted: Wed Apr 29, 2015 4:38 pm
by drhoward
Thank you! This worked. It was not clear to me from the dictionary writeup that the result flag would be handled in this manner.

Re: Message box popping up in middle of a run

Posted: Wed Apr 29, 2015 5:01 pm
by dunbarx
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