Procedure

TfrmOptionsNewList.btnOKClick

Module

fOptionsNewList

Last Modified

7/15/2014 3:26:40 PM

Visibility

Public/Published

Owner

TfrmOptionsNewList

Declaration

procedure btnOKClick(Sender: TObject);

Calls Hierarchy


TfrmOptionsNewList.btnOKClick
 └rpcNewList

Calls

Name Declaration Comments
rpcNewList function rpcNewList(aString: String; Visibility: integer): String; -


Source

61    procedure TfrmOptionsNewList.btnOKClick(Sender: TObject);
62    var
63      ok: boolean;
64    begin
65      ok := false;
66      with txtNewList do
67      begin
68        if (length(Text) < 3) or (length(Text) > 30) then
69          ShowMsg('Enter a valid name.')
70        else if not ContainsAlpha(txtNewList.Text[1]) then
71          ShowMsg('Enter a valid name.')
72        else
73        begin
74          FNewList := rpcNewList(Text, grpVisibility.ItemIndex);
75          if Piece(FNewList, '^', 1) = '' then
76            ShowMsg('Enter a valid name. ' + Piece(FNewList, '^', 2))
77          else
78            ok := true;
79        end;
80        if ok then Close
81        else
82        begin
83          Text := '';
84          SetFocus;
85        end;
86      end;
87    end;