From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
The "AskAndCall" function is commonly used in Clomosy programming to display a dialog box where you can request user confirmation. It has a structure similar to the [[Ask | "Ask"]] function. You can use this function to ask a question or present options to the user.
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
 
procedure Clomosy.AskAndCall(var AAskMessage,AYesButton,ANoButtun:String);
Clomosy.AskAndCall('Do you like Clomosy?','ProcYesOnClick','ProcNoOnClick');
</div>


The "AskAndCall" function is commonly used in Clomosy programming to display a dialog box where you can request user confirmation. It has a structure similar to the [[Ask | "Ask"]] function. You can use this function to ask a question or present options to the user.<br>
The "AskAndCall" function takes three parameters. The first parameter represents the question or prompt displayed in the dialog box. The second parameter specifies the action to be taken if the confirmation button is clicked. If the rejection button is clicked, the function will proceed to the action specified in the third parameter.
The "AskAndCall" function takes three parameters. The first parameter represents the question or prompt displayed in the dialog box. The second parameter specifies the action to be taken if the confirmation button is clicked. If the rejection button is clicked, the function will proceed to the action specified in the third parameter.


'''Example:'''<br>
<b>Example</b><br>
 
<b>TRObject Syntax</b><br>
:'''TRObject Syntax'''
<pre>
void ProcYes;
{
  ShowMessage('Yes Clicked');
}
void ProcNo;
{
  ShowMessage('No Clicked');
}
{
  Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
}
</pre>
<b>Base Syntax</b><br>
<pre>
procedure ProcYes;
begin
  ShowMessage('Yes Clicked');
end;
procedure ProcNo;
begin
  ShowMessage('No Clicked');
end;
   
   
  void ProcYes;
begin
  {
  Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
    ShowMessage('Yes Clicked');
end;
  }
</pre>
  void ProcNo;
  {
    ShowMessage('No Clicked');
  }
 
  {
    Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
  }


:'''Base Syntax'''
<h2> See Also </h2>
  procedure ProcYes;
* [[System_Library#Input-Output_Functions | Input Output Functions]]
  begin
    ShowMessage('Yes Clicked');
  end;
  procedure ProcNo;
  begin
    ShowMessage('No Clicked');
  end;
 
  begin
    Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
  end;

Revision as of 14:10, 7 October 2024

The "AskAndCall" function is commonly used in Clomosy programming to display a dialog box where you can request user confirmation. It has a structure similar to the "Ask" function. You can use this function to ask a question or present options to the user.
The "AskAndCall" function takes three parameters. The first parameter represents the question or prompt displayed in the dialog box. The second parameter specifies the action to be taken if the confirmation button is clicked. If the rejection button is clicked, the function will proceed to the action specified in the third parameter.

Example
TRObject Syntax

 void ProcYes;
 {
   ShowMessage('Yes Clicked');
 }
 void ProcNo;
 {
   ShowMessage('No Clicked');
 }
 
 {
   Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
 }

Base Syntax

 procedure ProcYes;
 begin
   ShowMessage('Yes Clicked');
 end;
 procedure ProcNo;
 begin
   ShowMessage('No Clicked');
 end;
 
 begin
   Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
 end;

See Also