Function Addon BlitzMax return -1

BlitzMax Forums/BlitzMax Programming/Function Addon BlitzMax return -1

Yue(Posted May) [#1]
Hi, I want to know what happens when a function from an external library returns -1.

What can you understand by that return value?


Derron(Posted May) [#2]
This depends on whatever the author tried to return.

Most often "-1" means:
- nothing important to report
- what you wanted to do failed
- the result id is invalid
- ...

So without stating what that function name is (might help) and more important what the libraries name is ... helping will become a bit harder.



bye
Ron


Floyd(Posted May) [#3]
If -1 is not a reasonable return value then it is probably some kind of error code. In that case it should be documented.


Midimaster(Posted May) [#4]
What values did you expect?

"-1" can also mean TRUE. So it is also possible, that the function wants to tell you, that the result is TRUE

f.e.
result=Confirm("Are you sure?")
print result



TomToad(Posted May) [#5]
The value could also be 4,294,967,295. If the function is suppose to return an unsigned int, then that value will be seen as -1 to BlitzMax which only uses signed ints.


Yue(Posted May) [#6]
i thanks for the answers I managed to find the problem here.

I was trying to load an animation from a b3d file, the function was XLoadAnimSeq, and apparently -1 equals 0 or false.

The problem was that the Fragmotion exporter has certain special requirements for Xors3D, for example you should not create an empty animation so that the anime mesh that loads xon xLoadAnimMesh is exported with the skeleton. On the other hand it is necessary that each bone has a vertex at least assigned.

If we use blitz3d, this does not happen, there are no problems, but when using BlitzMax + Xors3D I had that problem and when I wanted to load the animation it returned -1.

Greetings.


BlitzMan(Posted May) [#7]
Time to learn Bool Yue.