Firetron's FormatBoolean
stableDescription
Formats a boolean to a string so it can be logged.
HaasScript
-- ==========================================================================================================
-- Firetron's FormatBoolean
--
-- Formats a boolean to a string so it can be logged.
--
-- Discord: @FiretronP75
-- ==========================================================================================================
-- ==============
-- Definition
-- ==============
DefineCommand('FormatBoolean', 'Formats a boolean to a string so it can be logged.')
-- ==============
-- Parameters
-- ==============
local input = DefineParameter(BooleanType, 'Input', 'The boolean to format', true, false)
-- ==========
-- Output
-- ==========
local output = ''
if input then
output = 'true'
else
output = 'false'
end
DefineOutput(StringType, output, 'Formatted Value')
1 Comment
Sign in to leave a comment.
HaasScript errors if you try to log a boolean like Log('Is Open: '..isOpen)
You can do it by itself like Log(isOpen)
But then you have to put its label on an extra log output before it.
Is Open: true
is much nicer to see in the log than
Is Open:
true