EDOBE XDOM TAKE 6 IR - PRODUCTSHEET Especificaciones Pagina 233

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 304
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 232
CHAPTER 8: ExtendScript Tools and Features Preprocessor directives 233
X
Binary operators (+, -, *, /, %)
If one operand is
unitValue object and the other is a number, the operation is applied to the number
and the numeric value of the object. The expression returns a new
unitValue object with the result as
its
value. For example:
val = new UnitValue ("10 cm");
res = val * 20;
// res is a UnitValue (200, "cm");
If both operands are unitValue objects, JavaScript converts the right operand to the same unit as the
left operand and applies the operation to the resulting values. The expression returns a new
unitValue object with the unit of the left operand, and the result value. For example:
a = new UnitValue ("1 m");
b = new UnitValue ("10 cm");
a + b;
// res is a UnitValue (1.1, "m");
b + a;
// res is a UnitValue (110, "cm");
X
Comparisons (=, ==, <, >, <=, >=)
If one operand is a
unitValue object and the other is a number, JavaScript compares the number with
the
unitValue’s numeric value.
If both operands are
unitValue objects, JavaScript converts both objects to the same unit, and
compares the converted numeric values.
For example:
a = new UnitValue ("98 cm");
b = new UnitValue ("1 m");
a < b; // => true
a < 1; // => false
a == 98; // => true
Preprocessor directives
ExtendScript provides preprocessor directives for including external scripts, naming scripts, specifying a
JavaScript engine, and setting certain flags. Specify these with a C-style statement starting with the
#
character:
#include "file.jsxinc"
When a directive takes one or more arguments, and an argument contains any nonalphanumeric
characters, the argument must be enclosed in single or double quotes. This is generally the case with
paths and file names, for example, which contain dots and slashes.
+unitValue
Result is the numeric value.
-unitValue
Result is the negated numeric value.
Vista de pagina 232
1 2 ... 228 229 230 231 232 233 234 235 236 237 238 ... 303 304

Comentarios a estos manuales

Sin comentarios