Kyocera ECOSYS FS-4100DN PRESCRIBE Commands Technical Reference Manual - Rev. - Page 64

MCRO Command

Page 64 highlights

Chapter 3 Macros MCRO Command The MCRO command assigns a name to the sequence of PRESCRIBE commands that follows, until the ENDM (END Macro) command appears. Thereafter, the entire sequence of commands can be executed by specifying the assigned name in a single CALL or AMCR (Automatic MaCRo) command. The MCRO command has the following format. MCRO name[ dummy sign[, comment]; The name of a macro can be any length but only the first four characters are recognized by the PRESCRIBE command language. Any distinction between upper and lowercase letters is also ignored. For example, the following macro names are all the same: ABCD abcd ABCDE Abcdxyz The name must start with a letter, but the other characters can include digits and special symbols such as hyphens. For example, F-1 and GRY2 are valid macro names. The dummy sign (the default is the percent sign) indicates dummy parameters in the body of the macro. Dummy parameters enable you to place different variables when the macros are called. By using dummy parameters the same macro will execute differently according to the values given on the CALL command. Dummy parameters are written by writing the dummy sign followed by a number: %1 for the first dummy parameter, %2 for the second dummy parameter, and so on up to a maximum of 19 dummy parameters. The same dummy parameter can be used any number of times. Values are assigned to dummy parameters when the macro is called by the CALL command. You do not have to specify the dummy sign in the MCRO command unless you want to use a dummy sign different from the percent sign or want to specify a comment. The printing system ignores the comment. A useful comment would be a list of the meanings of dummy parameters. In particular, a macro can contain the CALL command, permitting one macro to call another. Macro calls can be nested in this way up to a maximum depth of 20. If the body of the macro contains TEXT, RTXT, or CTXT commands and these have dummy parameters, the enclosing quotation marks should be included in the macro call, not in the macro definition. This enables strings containing commas, semicolons, consecutive spaces, apostrophes, and quotation marks to be printed. If a macro with the same name has already been defined, the new definition is ignored. To redefine a macro, you must first delete the old definition with the DELM (DELete Macro) or DAM (Delete All Macros) command, or by switching the printing system power off. There is no particular limit on the length of a macro. The maximum number of macros that can be defined is limited only by the amount of the available memory in the printing system. Each command in a macro is limited to 255 characters in length. 3-2

  • 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
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260

Chapter 3 Macros
3-2
MCRO Command
The MCRO command assigns a name to the sequence of PRESCRIBE commands that
follows, until the ENDM (END Macro) command appears. Thereafter, the entire
sequence of commands can be executed by specifying the assigned name in a single
CALL or AMCR (Automatic MaCRo) command. The MCRO command has the follow-
ing format.
MCRO
name
[
dummy sign
[,
comment
];
The
name
of a macro can be any length but only the first four characters are recognized
by the PRESCRIBE command language. Any distinction between upper and lowercase
letters is also ignored. For example, the following macro names are all the same:
ABCD
abcd
ABCDE
Abcdxyz
The name must start with a letter, but the other characters can include digits and special
symbols such as hyphens. For example,
F-1
and
GRY2
are valid macro names.
The
dummy sign
(the default is the percent sign) indicates dummy parameters in the body
of the macro. Dummy parameters enable you to place different variables when the mac-
ros are called. By using dummy parameters the same macro will execute differently
according to the values given on the CALL command. Dummy parameters are written by
writing the dummy sign followed by a number:
%1
for the first dummy parameter,
%2
for the second dummy parameter, and so on up to a maximum of 19 dummy parameters.
The same dummy parameter can be used any number of times. Values are assigned to
dummy parameters when the macro is called by the CALL command.
You do not have to specify the dummy sign in the MCRO command unless you want to
use a dummy sign different from the percent sign or want to specify a comment. The
printing system ignores the comment. A useful comment would be a list of the meanings
of dummy parameters. In particular, a macro can contain the CALL command, permit-
ting one macro to call another. Macro calls can be nested in this way up to a maximum
depth of 20.
If the body of the macro contains TEXT, RTXT, or CTXT commands and these have
dummy parameters, the enclosing quotation marks should be included in the macro call,
not in the macro definition. This enables strings containing commas, semicolons, consec-
utive spaces, apostrophes, and quotation marks to be printed.
If a macro with the same name has already been defined, the new definition is ignored.
To redefine a macro, you must first delete the old definition with the DELM (DELete
Macro) or DAM (Delete All Macros) command, or by switching the printing system
power off.
There is no particular limit on the length of a macro. The maximum number of macros
that can be defined is limited only by the amount of the available memory in the printing
system. Each command in a macro is limited to 255 characters in length.