sendsms.pas

来自「请使用Mobile FBUS——用来创建与NOKIA手机连接的软件的理想解决方案」· PAS 代码 · 共 53 行

PAS
53
字号
unit SendSMS;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,sms;

type
  TfrmSendSMS = class(TForm)
    txtDestination: TEdit;
    btnSend: TButton;
    Label24: TLabel;
    mmoText: TMemo;
    lblTo: TLabel;
    procedure btnSendClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmSendSMS: TfrmSendSMS;

implementation

uses MainUnit;

{$R *.DFM}

procedure TfrmSendSMS.btnSendClick(Sender: TObject);
var
  imsgLength:longint;
begin
  imsgLength:=length(mmoText.text);
  if imsgLength > 150 then
    begin
      if messageDlg('Your SMS Message is greater than 150 characters. Your message will be split into '+inttostr(trunc(imsgLength div 150)+1)+' Messages. Continue ?', mtWarning,[mbYes,mbNo],0)=mrYes then
        frmMain.FBUS1.SMS.SendSMSMessage(txtDestination.text,mmoText.text,1,fbSMSClassNormal);
    end
  else
    frmMain.FBUS1.SMS.SendSMSMessage(txtDestination.text,mmoText.text,1,fbSMSClassNormal);
end;

procedure TfrmSendSMS.FormCreate(Sender: TObject);
begin
  mmoText.lines.Clear;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?