在线等 --50分 Delphi中怎么声明一个全局数组
解决方案 »
- Printer打印图像的问题
- Delphi如何结束程序?为什么我的程序窗体结束了,但是程序未能结束?
- 谁能给一个DBGRID 通过TextBox的值动态绑定数据的例子
- delphi中怎么将pchar转换成string型的?
- 能不能在一个单元格中显示多行数据
- 怎样改变鼠标状态?
- 把excel中的数据导入到oracle 数据库的一个表中
- 如何从我原来的图象上面截取一块图象保存?
- dll的问题,为什么建立dll的文件在目录下看不到?
- title(桶漆底脱) zhuoyuesky(卓越) kuangning(郎之间)(穷人)(其实什么都不是) gaochunzhen()进来拿分!!
- 关于数据库恢复的问题!!请大家指教!
- 请教一个dbexpress控件的问题~~
在此定义就行了,,
Form1: TForm1;
a: array[0..12] of DataType;
Form1: TForm1;
a: array[0..12] of DataType;
Form1: TForm1;
a: array[0..12] of DataType;
在此定义就行了,,和var
Form1: TForm1;
a: array[0..12] of DataType;两种方法定义有什么区别呢?
在此定义就行了,,和var
Form1: TForm1;
a: array[0..12] of DataType;两种方法定义有什么区别呢?
//第一种方法访问时要加上单元名,如unit1.变量名。
第二种方法直接写变量名就可以了。
//CNGP TLV Record
TCNGP_TLV = Packed Record
Paramter_Tag : SmallInt; //Tag of parameter
Length : SmallInt; //Length of value
Value : ShortInt; //Value
End; //CNGP Message Head
PCNGP_HEAD = ^TCNGP_HEAD;
TCNGP_HEAD = Packed Record
Total_Length : Longword; //Package length( include head and body )
Command_ID : Longword; //Communication command
Command_Status : Longword; //Command execute status code
Sequence_ID : Longword; //Working serial
End; //CNGP login request body
PCNGP_LOGIN = ^TCNGP_LOGIN;
TCNGP_LOGIN = Packed Record
Client_ID : Array [ 0 .. 9 ] Of Char; //SP Corporation ID
Authenticator_Client : Array [ 0 .. 15 ] Of Char; //Client MD5 result
Login_Mode : Byte; //Login types
Timestamp : Longword; //Login timestamp, format is 'mmddhhmmss'
Version : Byte; //Client support the highest CNGP protocol version
End; //CNGP login respond body
TCNGP_RESP_LOGIN = Packed Record
Authenticator_Server : Array [ 0 .. 15 ] Of Char; // Server MD5 result
Version : Byte; //Server support the highest CNGP protocol version
End; //CNGP submit body
PCNGP_SUBMIT = ^TCNGP_SUBMIT;
TCNGP_SUBMIT = Packed Record
SP_ID : Array [ 0 .. 9 ] Of Char; //SP Corporation ID
Sub_Type : Byte; //Short message sub tpyes
Need_Report : Byte; //Flag of report
Priority : Byte; //Short message transmit priority
Service_ID : Array [ 0 .. 9 ] Of Char; //Servcie of short message
Fee_Type : Array [ 0 .. 1 ] Of Char; // Fee type of short message
Fee_User_Type : Byte; // Fee user type of short message
Fee_Code : Array [ 0 .. 5 ] Of Char; //Fee of short message, unit is FEN
Msg_Format : Byte; //Short message format
Vaild_Time : Array [ 0 .. 16 ] Of Char; //Valid timestamp of short message, format is 'yyyymmddhhmmss'
At_Time : Array [ 0 .. 16 ] Of Char; //Transmit timestamp of short message, format is 'yyyymmddhhmmss'
Src_Term_ID : Array [ 0 .. 20 ] Of Char; //Source user phone code
Charge_Term_ID : Array [ 0 .. 20 ] Of Char; //Fee user phone code
Dest_Term_ID_Count : Byte; //Count of transmit user
//Dest_Term_ID : Array [ 0 .. 20 ] Of Char; //Target user phone code
//Msg_Length : Byte; //Length of short message
End; //CNGP submit respond body
TCNGP_RESP_SUBMIT = Packed Record
Msg_ID : Array [ 0 .. 9 ] Of Char; //Message ID of short message
Congestion_State : TCNGP_TLV; //TLV
End; //CNGP deliver body
PCNGP_DELIVER = ^TCNGP_DELIVER;
TCNGP_DELIVER = Packed Record
Msg_ID : Array [ 0 .. 9 ] Of Char; //Message ID of short message
Is_Report : Byte; //Flag of report
Msg_Format : Byte; //Short message format
Recv_Time : Array [ 0 .. 13 ] Of Char; //Recieve Timestamp
Src_Term_ID : Array [ 0 .. 20 ] Of Char; //Source user phone code
Dest_Term_ID : Array [ 0 .. 20 ] Of Char; //Target user phone code
Msg_Length : Byte; //Length of short message
End; //CNGP deliver respond body
TCNGP_RESP_DELIVER = Packed Record
Msg_ID : Array [ 0 .. 9 ] Of Char; //Message ID of short message
Congestion_State : TCNGP_TLV; //TLV
End; //CNGP MT report body
PCNGP_MT_REPORT = ^TCNGP_MT_REPORT;
TCNGP_MT_REPORT = Packed Record
ID : Array [ 0 .. 9 ] Of Char; //Message ID of short message
Sub : Array [ 0 .. 2 ] Of Char; //value is '001';
Dlvrd : Array [ 0 .. 2 ] Of Char; //value is '001';
Submit_Date : Array [ 0 .. 9 ] Of Char; //Submit timestamp of short message, format is 'yymmddhhmm'
Done_Date : Array [ 0 .. 9 ] Of Char; //Report timestamp of short message, format is 'yymmddhhmm'
Stat : Array [ 0 .. 6 ] Of Char; //State of short message
Err : Array [ 0 .. 2 ] Of Char; //Error code of short message
Txt : Array [ 0 .. 19 ] Of Char; //Information of short message
End; //Map of report error code and report state
TCNGP_REPORT_ERROR_STATE_MAP = Packed Record
Error_Code : Array [ 0 .. 2 ] Of Char; //Error Code
State : Array [ 0 .. 6 ] Of Char; //Report state
End; ......Var
//以下就是你需要的全局数组的定义!!!
Report_Map : Array [ 0 .. 10 ] Of TCNGP_REPORT_ERROR_STATE_MAP =
(
( Error_Code : REPORT_ERROR_SUCCESS; State : REPORT_STATE_DELIVERED ),
( Error_Code : REPORT_ERROR_COMUNICATION; State : REPORT_STATE_EXPIRED ),
( Error_Code : REPORT_ERROR_USER_BUSY; State : REPORT_STATE_EXPIRED ),
( Error_Code : REPORT_ERROR_INVALID_TERM; State : REPORT_STATE_UNDELIVERABLE ),
( Error_Code : REPORT_ERROR_INVALID_USER; State : REPORT_STATE_UNDELIVERABLE ),
( Error_Code : REPORT_ERROR_BLACK_LIST; State : REPORT_STATE_UNDELIVERABLE ),
( Error_Code : REPORT_ERROR_SYSTEM; State : REPORT_STATE_UNDELIVERABLE ),
( Error_Code : REPORT_ERROR_OUTOF_MEMORY; State : REPORT_STATE_EXPIRED ),
( Error_Code : REPORT_ERROR_INVALID_SRC_TERM; State : REPORT_STATE_UNDELIVERABLE ),
( Error_Code : REPORT_ERROR_DATA; State : REPORT_STATE_UNDELIVERABLE ),
( Error_Code : REPORT_ERROR_LOST_DATA; State : REPORT_STATE_UNDELIVERABLE )
);
implementationend.
窗口级的,我一般定义在
private
{ Private declarations }
FStep:integer;或
implementation
var
FStep:integer;如果这个变量是这个窗口的,但其它的窗口会访问到。刚放在
public
{ Public declarations }
FStep:integer;