Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Can a subroutine return a 64-bit integer?

In the RETURN command from a GOSUB? I think that's the same thing as an exit code or %ERRORLEVEL% -- a 32-bit integer.
 
In the RETURN command from a GOSUB? I think that's the same thing as an exit code or %ERRORLEVEL% -- a 32-bit integer.
Yeah! I found out the hard way. I have a subroutine to compute multinomial coefficients and started getting screwy results when the numbers got big.
 
ERRORLEVEL is 32-bit because (1) nobody has ever (until now!) needed more, and (2) 64-bit returns would break CMD compatibility.

But there's no reason you have to pass it back through RETURN or ERRORLEVEL; you could as easily put it in an environment variable (and have more bits than you could ever use).
 
ERRORLEVEL is 32-bit because (1) nobody has ever (until now!) needed more, and (2) 64-bit returns would break CMD compatibility.

But there's no reason you have to pass it back through RETURN or ERRORLEVEL; you could as easily put it in an environment variable (and have more bits than you could ever use).
Yup, that's what I did.
 

Similar threads

Back
Top