-
Notifications
You must be signed in to change notification settings - Fork 1
/
FieldHexadecimalIndicator.swift
43 lines (40 loc) · 1.48 KB
/
FieldHexadecimalIndicator.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// FieldHexadecimalIndicator.swift
//
//
// Created by chen on 2023/11/11.
//
import Foundation
/// The ^FH command allows you to enter the hexadecimal value for any character directly into the ^FD statement.
/// The ^FH command must precede each ^FD command that uses hexadecimals in its field.
///
/// # Field Hexadecimal Indicator
///
/// Within the ^FD statement, the hexadecimal indicator must precede each hexadecimal value.
/// The default hexadecimal indicator is _ (underscore).
/// There must be a minimum of two characters designated to follow the underscore.
/// The a parameter can be added when a different hexadecimal indicator is needed.
///
/// This command can be used with any of the commands that have field data (that is ^FD, ^FV (Field Variable),
/// and ^SN (Serialized Data)).
///
/// Valid hexadecimal characters are:
///
/// 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
public struct FieldHexadecimalIndicator: ZPLCommandConvertible {
/// Hexadecimal indicator.
///
/// Values: any character except current format and control prefix (^ and ~ by default)
///
/// Default: _ (underscore)
public var indicator: Character
public var command: String {
"^FH\(indicator)"
}
/// Field Hexadecimal Indicator
///
/// - Parameter indicator: Hexadecimal indicator. Any character except current format and control prefix (^ and ~ by default).
public init(indicator: Character = "_") {
self.indicator = indicator
}
}