SIMPOL Documentation

Message Boxes in SIMPOL

An extremely common requirement in programming is to be able to communicate with the user via a dialog box that displays a message. The dialog box should normally not permit the user to continue until they have responded to the message. Most operating systems provide this type of functionality although they differ in the details of how many different styles of message box may exist and therefore how many different icon types or button combinations can be provided.

The message box function can be very simple. As little as:

  string sResponse
  sResponse = .nul
  wxmessagedialog(.nul, "Hello world!", "Message from SIMPOL", \
                  "ok", result=sResponse)

It can also be as complicated as:

  string sResponse
  sResponse = .nul
  wxmessagedialog(.nul, "Hello world!", "Message from SIMPOL", \
              "yesno_defaultno", "question", result=sResponse)

This example shows a Yes and a No button and also shows an icon indicating the purpose of the message. Currently there are only six possible values for the icon, "", "question", "error", "exclaim", "hand", or "information". For full information on the various parameters see the section covering the wxmessagedialog() function in the "SIMPOL Language Reference".