Resource

Resource Basics

Resource Name Basics of Say and Ask
Resource Version 1.0
Category Tutorials
Downloads 800
Release Date 6/7/2018 4:52:31 PM
 

Resource Details

Description This script demonstrates the basics of the Say and Ask commands
Installation Instructions Download to your hard drive
Usage Instructions 1. Open in Tools -> Scripter
2. Run
Changes in this version n.a.
Special Requirements 4.1.0.1466
 

Author Information

Author Name IDimager Support
 

Script

procedure SaySimple;
begin
  Say('Hello world');
  Say2('Hello', 'World');
  Say3('Hello', 'World', 'what a wonderful world');
end;

procedure AskSimple;
begin
  if Ask('This is a question. What''s your answer?') then
    Say('you clicked Yes')
  else
    Say('you clicked No');
end;

procedure AskCustomList;
var
  ASl: TTntStringList;
  AChecked: Boolean;
  ARes: Integer;
begin
  AChecked := True;
  ASl := TTntStringList.Create;
  ASl.Add('john');
  ASl.Add('jane');
  ASl.Add('baby');
  ASl.Add('janie');
  ASl.Add('johnny');
  ARes := AskCustom(
            'select option',
            'sub text',
            '',   // 'info text'
            '',   // 'check this'
            AChecked,
            ASl
          );
  if (ARes <> -1) and (ARes <> -99 {cancel}) then
  begin
    Say('You clicked: ' + ASl.Strings[ARes]);
  end;
  ASl.Free;
end;

procedure AskCustomChecked;
var
  ASl: TTntStringList;
  AChecked: Boolean;
  ARes: Integer;
begin
  AChecked := True;
  ASl := TTntStringList.Create;
  ASl.Add('?john');
  ASl.Add('?jane');
  ASl.Add('?baby');
  ASl.Add('?janie');
  ASl.Add('?johnny');
  ARes := AskCustom(
            'select option',
            'sub text',
            '',   // 'info text'
            '',   // 'check this'
            AChecked,
            ASl
          );
  if ARes <> -1 then
  begin
    Say(ASl.Text);
  end;
  ASl.Free;
end;

SaySimple;
AskSimple;
AskCustomList;
AskCustomChecked;