From Clomosy Docs

No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
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>
:'''Base Syntax'''
<pre>
  var
  void ProcYes;
  MyForm:TCLForm;
{
  askAndCallBtn:TCLButton;
  ShowMessage('Yes Clicked');
  procedure ProcYes;
}
  begin
void ProcNo;
    ShowMessage('Yes Clicked');
{
  end;
  ShowMessage('No Clicked');
  procedure ProcNo;
  }
  begin
    ShowMessage('No Clicked');
  end;
procedure askAndCallBtnOnClick;
  begin
    Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
  end;
begin
  MyForm := TCLForm.Create(Self);
   
  askAndCallBtn:= MyForm.AddNewButton(MyForm,'askAndCallBtn','AskAndCall Function');
  askAndCallBtn.Align:=alTop;
  askAndCallBtn.Margins.Top:=20;
  askAndCallBtn.Margins.Right:=20;
  askAndCallBtn.Margins.Left:=20;
  askAndCallBtn.Margins.Bottom:=20;
  MyForm.AddNewEvent(askAndCallBtn,tbeOnClick,'askAndCallBtnOnClick');
   
   
  MyForm.Run;
{
  end;
  Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
  }
</pre>


:'''TRObject Syntax'''
<h2> See Also </h2>
  var
* [[System_Library#Input-Output_Functions | Input Output Functions]]
    MyForm:TCLForm;
{{#seo:|title=AskAndCall Using in Clomosy - Clomosy Docs}}
    askAndCallBtn:TCLButton;
{{#seo:|description=Explore AskAndCall on Clomosy. Learn how to implement effective user input and function calling in your applications.
  void ProcYes;
}}
  {
    ShowMessage('Yes Clicked');
  }
  void ProcNo;
  {
    ShowMessage('No Clicked');
  }
  void askAndCallBtnOnClick;
  {
    Clomosy.AskAndCall('Do you like Clomosy?','ProcYes','ProcNo');
  }
 
  {
    MyForm = TCLForm.Create(Self);
   
    askAndCallBtn= MyForm.AddNewButton(MyForm,'askAndCallBtn','AskAndCall Function');
    askAndCallBtn.Align=alTop;
    askAndCallBtn.Margins.Top=20;
    askAndCallBtn.Margins.Right=20;
    askAndCallBtn.Margins.Left=20;
    askAndCallBtn.Margins.Bottom=20;
    MyForm.AddNewEvent(askAndCallBtn,tbeOnClick,'askAndCallBtnOnClick');
   
    MyForm.Run;
  }

Latest revision as of 13:29, 24 December 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

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

See Also