Epson FX-286 User Manual - Page 86

Designing Your Own Graphics, CHR$27LCHR$N MOD 256CHR$INTN/256

Page 86 highlights

If you need fewer than 255 columns of graphics, n1 is the number of columns you want and n2 is zero. As you can see in Table 6-1, however, a single eight-inch line will hold as many as 1920 columns in quadruple-density. Specifying more than 255 is where the second number slot (N2) fits in. The first number that you send (n1) indicates a number of columns, but the second does not represent a number of columns; it is multiplied by 256 and added to n1. The command for the maximum number of dot positions you can reserve is: CHR$(27)"*"CHR$(3)CHR$(192)CHR$(12); which is 192 dot positions plus 12 times 256 dot positions, for a total of 3264 dot positions in one row. Once you have chosen the number of columns you want to use, you can have your program do the calculations for you with the following format: CHR$(27)"L"CHR$(N MOD 256)CHR$(INT(N/256)); The variable N is the total number of columns you want to specify. The MOD (modulus) function calculates the value for n1, and the INT (integer) function calculates the value for n2. For programming languages other than BASIC, consult your manual for the proper form for these functions. This format can be used with any graphics density and with any value of N up to the maximum number of columns per line for that density. Designing Your Own Graphics This section takes you through the development of a graphics program. The example is not especially complicated, but it does include the same steps you would use for a more complex figure so that you have the basis for designing graphics on your FX-286. 6-11

  • 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

If you need fewer than 255 columns of graphics,
n1
is the number of
columns you want and n2 is zero. As you can see in Table
6-1,
how-
ever, a single eight-inch line will hold as many as
1920
columns in
quadruple-density. Specifying more than 255 is where the second
number slot (N2) fits in. The first number that you send
(n1)
indicates a
number of columns, but the second does not represent a number of
columns; it is multiplied by 256 and added to
n1.
The command for
the maximum number of dot positions you can reserve is:
CHR$(27)"*"CHR$(3)CHR$(192)CHR$(12);
which is
192
dot positions plus
12
times
256
dot positions, for a total of
3264 dot positions in one row.
Once you have chosen the number of columns you want to use,
you can have your program do the calculations for you with the fol-
lowing format:
CHR$(27)"L"CHR$(N MOD 256)CHR$(INT(N/256));
The variable N is the total number of columns you want to specify.
The MOD (modulus) function calculates the value for n1, and the INT
(integer) function calculates the value for n2. For programming lan-
guages other than BASIC, consult your manual for the proper form
for these functions.
This format can be used with any graphics density and with any
value of N up to the maximum number of columns per line for that
density.
Designing Your Own Graphics
This section takes you through the development of a graphics pro-
gram. The example is not especially complicated, but it does include
the same steps you would use for a more complex figure so that you
have the basis for designing graphics on your FX-286.
6-11