Exemplo n.º 1
0
func (vm *VM) Extract_variable_as_int(variable_name string) (int, 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 0, nil
	}

	res := int(C.unqlite_value_to_int(unqlite_value.unqlite_value))
	return res, GlobaLError("OK")
}
Exemplo n.º 2
0
func (v *Value) ToInt() int {
	i := C.unqlite_value_to_int(v.v)
	return int(i)
}