📄 sim_canshu.pas
字号:
unit sim_canshu;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls;
type
sim_at=record
simat_num:integer ;
simat_str:string ;
end;
//AT+CMGL命令参数
//TYPE at_cmgl
//特殊键
const cnhuiche=chr(13); //回车
const cnhuanhang=chr(10) ; //换行
const cnctrl_z=chr(26) ; //ctrl+z
//10进制转16进制用
const cScaleChar = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
//隐藏窗口的参数
const MY_MESSAGE = WM_USER + 200;
//wavecom命令集
//////// A/ //重复上次的操作
const at_cmgf = 1 ; //设置短消息支持的格式(TEXT或PDU)
const at_WLPR = 2 ; //设置所支持的语言
const at_CGMI = 3 ; //获得厂家的标识
const at_CGMM = 4 ; //查询支持频段
const at_CGMR = 5 ; //查询软件版本
const at_CGSN = 6 ; //查询生产序列号
const at_CSCS = 7 ; //选择支持网络
const at_CIMI = 8 ; //查询国际移动电话支持认证
const at_CCID = 9 ; //查询SIM卡序列号
const at_GCAP =10 ; //查询可使用的功能列表
const at_CMGI =11 ; //选择当有新消息来时系统的提示方式
const at_CMGR =12 ; //读取短消息
const at_CMGL =13 ; //将存储的短消息列表
const at_CMGS =14 ; //发送短消息
const at_CMGW =15 ; //写短消息并保存在存储器中
const at_CMSS =16 ; //发送保存在存储器中的短消息
const at_CSMP =17 ; //设置在TEXT模式下的参数
const at_CMGD =18 ; //删除短消息
const at_CSCA =19 ; //提供短消息服务中心号码
const at_WMSC =20 ; //修改短消息位置
const at_WMGO =21 ; //写一条短消息放在第一个空位
function jianban(num:integer):integer ;
function str_Gb2UniCode( text: string ): String;
function IntToDigit(mNumber: Integer; mScale: Byte;mLength: Integer = 0): string;
{ 返回整数的进制表示;mScale指定多少进制;mLength指定长度,长度不足时向前补0 }
type
tsim_xinxi=array[1..5,1..10] of string;
var
sim_xinxi:tsim_xinxi ;
procedure init_sim_xinxi();
implementation
function jianban(num:integer):integer ;
var
i,j,k:integer ;
begin
j:=0;
k:=0;
for i:=1 to num do
begin
j:=j+1 ;
if j=2 then
begin
k:=k+1 ;
j:=0;
end;
end;
jianban:=k;
end;
function str_Gb2UniCode( text: string ): String;
var
i,j,len:Integer;
cur:Integer;
t:String;
ws:WideString;
begin
Result:='';
ws := text;
len := Length(ws);
i := 1;
j := 0;
while i <= len do
begin
cur := ord(ws[i]);
FmtStr(t,'%4.4X',[cur]); //BCD转换
Result := Result+t;
inc(i);
//移位计数达到7位的特别处理
j := (j+1) mod 7;
end;
end;
function IntToDigit(mNumber: Integer; mScale: Byte;
mLength: Integer = 0): string;
{ 返回整数的进制表示;mScale指定多少进制;mLength指定长度,长度不足时向前补0 }
var
I, J: Integer;
begin
Result := '';
I := mNumber;
while (I >= mScale) and (mScale > 1) do begin
J := I mod mScale;
I := I div mScale;
Result := cScaleChar[J + 1] + Result;
end;
Result := cScaleChar[I + 1] + Result;
for I := 1 to mLength - Length(Result) do Result := '0' + Result;
end; { IntToDigit }
procedure init_sim_xinxi();
var
i,j:integer;
begin
for i:=1 to 5 do
begin
for j:=1 to 10 do
begin
sim_xinxi[i,j]:='';
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -