Bản khảo sát nghiên cứu: Cho chúng tôi biết trải nghiệm của bạn khi sử dụng Blockly
Bắt đầu khảo sát
blockly > Block > setOutput
Phương thức Block.setOutput()
Đặt xem khối này có trả về giá trị hay không.
Chữ ký:
setOutput(newBoolean: boolean, opt_check?: string | string[] | null): void;
Tham số
Thông số |
Loại |
Mô tả |
newBoolean |
boolean |
Đúng nếu có đầu ra. |
opt_check |
string | string[] | null |
(Không bắt buộc) Loại dữ liệu trả về hoặc danh sách các loại dữ liệu trả về. Rỗng hoặc không xác định nếu có thể trả về bất kỳ loại nào (ví dụ: get biến). |
Trả về:
void
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-11-30 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-30 UTC."],[[["The `setOutput` method determines if a block produces a value or not."],["It takes a boolean argument (`newBoolean`) indicating the output status and an optional `opt_check` for specifying the output type(s)."],["Calling `setOutput` does not return any value (void)."]]],["The `Block.setOutput()` method determines if a block returns a value. It accepts a boolean `newBoolean`: `true` indicates an output exists, `false` otherwise. An optional `opt_check` parameter specifies the type or types returned, using a string or string array. If `null` or `undefined`, any type is acceptable. The method's return type is `void`. The key actions are setting and defining the parameters of a block's output status and its type.\n"]]