true (value)


The true value is a boolean "non zero". It is the only alternative to the boolean false value.

Examples

Suppose you want to attach the image pointer im to CImage object I. The example below shows 2 equivalent ways to test the returned value:

bSuccess = I:Attach( im )

-- returns true if the im is attached.

if bSuccess ~= true then Exit() end

-- exit if bSuccess is not true

Alternatively, the same result is accomplished by the following code:

bSuccess = I:Attach( im )

-- returns true if the im is attached.

if not bSuccess then Exit() end

-- exit if bSuccess is not true

Related Topics

false

nil