附录 H. 示例:字段
H.3 字段
本节为几种不同的字段(Keywords、Text、Subject、Vendor-Defined)分别给出 Field 数据元素构造器的示例。
Keywords 字段的 Field 数据元素。该字段包含两个关键词 Message 和 Computer,各用一个单独的 ASCII-String 数据元素表示。
Field Length Keywords ASCII Length
+--------+--------+--------+--------+--------+
|01001100| 1 4 | 1 4 |00000010| 0 7 |
+--------+--------+--------+--------+--------+
+--- ---+
|Message|
+--- ---+
ASCII Length
+--------+--------+--- ---+
|00000010| 0 8 |Computer|
+--------+--------+--- ---+
带有附加批注的 Property-List 数据元素的 Text 字段 Field 数据元素。Text 字段包含 ASCII-String 数据元素 "Do you want lunch?";Property-List 数据元素包含一个 Comment 属性,该属性由包含 "Now?" 的 ASCII-String 数据元素组成:
Field Length Text Prop-List Length
+--------+--------+--------+--------+--------+
|11001100| 2 0 | 0 4 |00100100| 0 9 |
+--------+--------+--------+--------+--------+
Property Length PID ASCII
+--------+--------+--------+--------+
|01000101| 0 7 | 0 1 |00000010|
+--------+--------+--------+--------+
Length
+--------+- -+
| 0 4 |Now?|
+--------+- -+
ASCII Length
+--------+--------+---- ----+
|00000010| 1 2 |Do you want lunch?|
+--------+--------+---- ----+
Subject 字段的 Field 数据元素,包含一个 ASCII-String 数据元素("Good restaurants in Detroit",后跟一个回车符和一个换行符)。(接收者会预期这条消息包含一些有关底特律地区餐馆的信息。):
Field Length Subject ASCII Length
+--------+--------+--------+--------+--------+
|01001100| 2 1 | 0 7 |00000010| 1 E |
+--------+--------+--------+--------+--------+
+---- ----+
|Good restaurants in Detroit.<cr><lf>|
+---- ----+
形式和含义由供应商定义的 Field 数据元素。这家供应商把供应商定义的 12 号字段(十进制)定义为一个打印名称为 "Reply-by"、内容为日期的字段,本例中日期为 1981 年 1 月 7 日。(供应商定义的 12 号字段的含义只对该供应商而言是唯一的,同一个字段编号对其他供应商可能有不同的含义。):
Field Length Qualifier User number
+--------+--------+--------+--------+--------+
|11001100| 1 F | 8 2 | 0 0 0 C |
+--------+--------+--------+--------+--------+
Prop-List Length Property Length
+--------+--------+--------+--------+
|00100100| 0 E |01000101| 0 C |
+--------+--------+--------+--------+
PID ASCII Length
+--------+--------+--------+---- ----+
| 0 2 |00000010| 0 9 |Reply-By:|
+--------+--------+--------+---- ----+
Date Length ASCII Length
+--------+--------+--------+--------+
|00101000| 0 A |00000010| 0 8 |
+--------+--------+--------+--------+
+--- ---+
|19810107|
+--- ---+