예제 #1
0
func (vm *VM) Extract_variable_as_bool(variable_name string) (bool, error) {
	/*Extract a variable from the VM after if have been executed
	If something went wrong return nil
	*/
	var unqlite_value *Unqlite_value
	unqlite_value = vm.Unqlite_vm_extract_variable(variable_name)
	if !unqlite_value_ok(unqlite_value) {
		return false, nil
	}

	res := int(C.unqlite_value_to_bool(unqlite_value.unqlite_value))
	return res != 0, GlobaLError("OK")
}
예제 #2
0
func (v *Value) ToBool() bool {
	i := C.unqlite_value_to_bool(v.v)
	return int(i) != 0
}