跳到主要内容

TRUE

返回 true 逻辑值。

语法

expression.TRUE();

expression - 表示 ApiWorksheetFunction 类的变量。

参数

此方法没有任何参数。

返回值

boolean

示例

在电子表格中返回逻辑真值。

// How do I insert the logical true value into a cell in a spreadsheet?

// Set a cell to the boolean true value in a spreadsheet.

const worksheet = Api.GetActiveSheet();

let logical1 = 1 > 0;
let logical2 = 2 > 0;

let func = Api.WorksheetFunction;
let ans = func.XOR(logical1, logical2); //Works on XOR gate logic

worksheet.GetRange("C1").SetValue(ans);