该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


New Table( "Testing Comparisons",
New Column( "A",
"Continuous",
Format( "Best", 10 ),
Set Values( [1, 2, 3, .] )
New Column( "B", Character, "Nominal", Formula( If( :A, "true", 1, "false" ) ) )
If the value of A is nonmissing and nonzero, the result is "true". This comparison is true for the first three rows.
注意: 
a = "a";
If( a, "true", "false" );
When one value is false and another one is missing, Or() returns missing. Use OrMZ() to return false instead. See “OrMZ(a, b)” in the JSL Syntax Reference for details.
When one value is true and another one is missing, And() returns missing. Use AndMZ() to return false instead. See “AndMZ(a, b)” in the JSL Syntax Reference for details.
If you know that some values are missing, you can also compare with Is Missing(). The comparison in the preceding example can be rewritten to return "missing" for missing values:
If the missing value could be 0, use the Zero Or Missing() function instead: