Return value of MsgBox button requires int32, Why?

Why does the MsgBox button return value to be of int32 ? the doc says return integer.

dim iResult As integer
iResult = MsgBox(“Test message” + EndOfLine + EndOfLine + “new line”, MsgBox.Button.YesNo + MsgBox.Icon.Question, “Message Title”)
MsgBox("Button clicked: " + if (iResult = int32(msgbox.Result.Yes), “Yes”, “No”) )

Integer is an Int32.

The Integer type is an alias to the platform’s native signed integer type. On 32-bit builds, this ends up being Int32 and on 64-bit builds this ends up being Int64.

int32 is an integer, right, but why do I get an error message when I use integer instead of int32 ?

Probably because the error message has nothing to do with that.
Am I correct in assuming you copied that from a VB6 program?

  dim iResult As integer
  iResult = MsgBox("Test message" + EndOfLine + EndOfLine + "new line", 4+32, "Message Title")
  MsgBox("Button clicked: " + if (iResult = 6, "Yes", "No") )

there are no MSGBOX enumerations

no it’s not copied from VB6, I red the doc how to use enum’s, and liked it, tried to implement enums for msgbox buttons return value which requires an int32, even the enum values are defined as integer.

Where are you finding these documented?


My compiler says they do not exist

I created those enums myself.

What’s the error message you’re getting?

it requires an int32 …

but I don’t beliefe it, it’s now working, I compiled the app to tell you the error message and there is none,
hours ago I could not compile without error.
strange …

thanks Dave and Kem

Per the LangRef… you use INT32 to cast Enums

yes, I used int32 because the error message said it is expecting int32 and integer gave me an error.
now it compiles with integer, who knows why …

thanks Dave

Naturally I take full credit for your success.

that’s true Kem, because of you I recompiled the app

many thanks