Well, my certainty was misplaced; I do indeed have a MsgBox that displays a variable. The problem is with the data looked at by this code:
vBillingNotes = @XLookup(@FN, Bill_To_Code, "CUSTOMER!CODE", "Billing_Notes")
If Not @Error Then
{
// Writeln(sExceptionLookupFlag)
IF NOT sExceptionLookupFlag = Bill_To_Code
THEN
{
@MSGBOX(vBillingNotes, "", "")
sExceptionLookupFlag = Bill_To_Code
// Writeln(sExceptionLookupFlag)
}
}
// Else WriteLn("Lookup of Billing Notes info Failed")
This is part of a larger subroutine that looks up billing information, in this case the value in the Billing_Notes field of my customer database. sExceptionLookupFlag is a static declared at the beginning of my Global code and set to 0 in on-form-entry. The above code sets it to equal the customer bill-to code once the lookup has run, so that the billing notes message will only display once, or again if the bill to code changes.
The problem is that recently a number of customer's billing notes were deleted, when my Rigging dispatcher told me he knew the details of certain customers by heart and did not need the message popping up each time he billed them. But! For those customers who once had details which have now been deleted, this empty @MsgBox pops up. For customers with valid billing notes it pops up with those notes displayed. For customers who never had billing notes, it does not pop up at all because the lookup returns with an error, and IF @ERROR prevents the display.
So It seems like I have a 3 state set which I have to check for before allowing this box to pop up. I'll have to experiment with this.
Thanks for the pointers, Erika and Ray, which helped me track this down.