From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
procedure ShowMessage(const Text string);
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
procedure ShowMessage(const AMessage: string);
</div>
   
   
Applications or the operating system itself use message windows to warn or inform the user. Message windows can be created in clomosy applications using ShowMessage.<br>
Applications or the operating system itself use message windows to warn or inform the user. The title of the window is the project name. There is no option to click other than the OK button.<br>
In simple terms, it is a message window that can be used to inform the user. It has only one parameter that receives the message to be displayed on the screen. The title of the window is the project name. There is no option to click other than the OK button. The message window is displayed in the middle of the screen.<br>


Insert carriage return and line feed characters (#13#10) into the string to generate multi line message display.<br>
ShowMessage Behaves Differently On Different Platforms
On desktop platforms, ShowMessage behaves synchronously. The call finishes only when the user closes the dialog box.
On mobile platforms, ShowMessage behaves asynchronously. The call finishes instantaneously, it does not wait for the user to close the dialog box.


'''Example:'''<br>
:'''Base Syntax'''
  var
    word : String;
  begin
    word := 'Hello World';
    // Show a simple message
    ShowMessage(word);
   
    // Show a blank message
    ShowMessage(<nowiki>''</nowiki>);
   
    // Split this into two lines
    ShowMessage('Hello '+#13#10+'World');
  end;


:'''TRObject Syntax'''
<div class="alert alert-info" role="alert" data-bs-theme="light">
  var
<b>NOTE:</b> Insert carriage return and line feed characters (#13#10) into the string to generate multi line message display.
    word : String;
</div>
  {
 
    word = 'Hello World';
<b>Example</b><br>
    // Show a simple message
<b>TRObject Syntax</b><br>
    ShowMessage(word);
<pre>
   
var
    // Show a blank message
  word : String;
    ShowMessage(<nowiki>''</nowiki>);
{
   
  word = 'Hello World';
    // Split this into two lines
  // Show a simple message
    ShowMessage('Hello '+#13#10+'World');
  ShowMessage(word);
  }
 
  // Show a blank message
  ShowMessage('');
 
  // Split this into two lines
  ShowMessage('Hello '+#13#10+'World');
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
  word : String;
begin
  word := 'Hello World';
  // Show a simple message
  ShowMessage(word);
 
  // Show a blank message
  ShowMessage('');
 
  // Split this into two lines
  ShowMessage('Hello '+#13#10+'World');
end;
</pre>


'''Output:'''<br>
'''Output:'''<br>
Line 42: Line 53:
  Output3: Hello
  Output3: Hello
           World
           World
<b>Output:</b><br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
Output1: Hello World<br>
Output2:<br>
Output3: Hello<br>
:::World
</div>
<h2> See Also </h2>
* [[System_Library#Input-Output_Functions | Input Output Functions]]

Revision as of 13:33, 7 October 2024

Applications or the operating system itself use message windows to warn or inform the user. The title of the window is the project name. There is no option to click other than the OK button.

ShowMessage Behaves Differently On Different Platforms On desktop platforms, ShowMessage behaves synchronously. The call finishes only when the user closes the dialog box. On mobile platforms, ShowMessage behaves asynchronously. The call finishes instantaneously, it does not wait for the user to close the dialog box.


Example
TRObject Syntax

 var
   word : String;
 {
   word = 'Hello World';
   // Show a simple message
   ShowMessage(word);
   
   // Show a blank message
   ShowMessage('');
   
   // Split this into two lines
   ShowMessage('Hello '+#13#10+'World');
 }

Base Syntax

 var
   word : String;
 begin
   word := 'Hello World';
   // Show a simple message
   ShowMessage(word);
   
   // Show a blank message
   ShowMessage('');
   
   // Split this into two lines
   ShowMessage('Hello '+#13#10+'World');
 end;

Output:

Output1: Hello World
Output2:
Output3: Hello
         World

Output:

See Also