MessageBox "Does Not Exist" error in Console Apps

In the Xojo docs here: https://documentation.xojo.com/api/language/me.htmlssageBox it says:

When used in console apps:

MessageBox(message)

Works the same as Print. The message is output to the console/terminal.

But… in Xojo2021r3.1 on Big Sur I get an “This item does not exist” error when I attempt to compile.

If I change “MessageBox” back to “MsgBox” in the method, there’s no error.

Based on the documentation snippet quoted above, this feels like a bug with MessageBox.

It’s a documentation bug. Use Print or StdErr.WriteLine

@Greg_O_Lone , understood and thank you for the update.

Please note, MessageBox does “fallback” to Print in console apps when using older Xojo versions (for sure 2019r3.2).

I’m fairly certain about this because the errors above are from some external shared libraries used across multiple products in our suite of offerings, and, when I build this same project in Xojo 2019r3.2, there’s no compiler errors.

The “real” fix in my case (since none of the message box calls are actually used in console builds) would either be to uncheck console target “Include In” for each of the affected methods (there are hundreds) or just revert all the calls to “MsgBox”.

For now, I’ve punted and chosen the latter, converted all the calls back to MsgBox, and added a reminder to clean them up at a later date.

Also…… good luck in whatever new journeys lie ahead!! :slight_smile: